]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Python 3: replace "im_self" by "__self__"
authorShuangtai Tian <shuangtai.tian@intel.com>
Thu, 20 Feb 2014 06:43:11 +0000 (14:43 +0800)
committerShuangtai Tian <shuangtai.tian@intel.com>
Wed, 26 Feb 2014 08:27:51 +0000 (16:27 +0800)
The Python 3 removed the "im_self" attribute and only supports the
"__self__". This patch replaces "im_self" by "__self__" attribute.

Closes-Bug: #1282514
Change-Id: Ib017fff4b720a5dd7ee27fd01b36a531d9b6ca9c

cinder/volume/flows/common.py

index f5e34d4fe38951e28c712d4333a9dd1e89fcda75..2378db853f27e1f92c3ca3dd9dc2c989c5953927 100644 (file)
@@ -32,9 +32,9 @@ def make_pretty_name(method):
     """Makes a pretty name for a function/method."""
     meth_pieces = [method.__name__]
     # If its an instance method attempt to tack on the class name
-    if hasattr(method, 'im_self') and method.im_self is not None:
+    if hasattr(method, '__self__') and method.__self__ is not None:
         try:
-            meth_pieces.insert(0, method.im_self.__class__.__name__)
+            meth_pieces.insert(0, method.__self__.__class__.__name__)
         except AttributeError:
             pass
     return ".".join(meth_pieces)