summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemyslaw Gajda <quermit@gmail.com>2012-04-23 00:13:21 +0200
committerPrzemyslaw Gajda <quermit@gmail.com>2012-04-23 00:13:21 +0200
commit7de1beb8c8d47f43d6645430e2b3dca2c3aa19a8 (patch)
treeb65d4fad174de74bce5308293aa2f87fe58fa85c
parentb13fe45f54ce81cf79286e7eee8e3dfbe96023b3 (diff)
downloadpymox-7de1beb8c8d47f43d6645430e2b3dca2c3aa19a8.tar.gz
Fixed compatiblity issues in stubout
-rw-r--r--stubout.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/stubout.py b/stubout.py
index 65a0c88..7175b52 100644
--- a/stubout.py
+++ b/stubout.py
@@ -61,7 +61,7 @@ class StubOutForTesting:
Raises AttributeError if the attribute cannot be found.
"""
if (inspect.ismodule(obj) or
- (not inspect.isclass(obj) and obj.__dict__.has_key(attr_name))):
+ (not inspect.isclass(obj) and attr_name in obj.__dict__)):
orig_obj = obj
orig_attr = getattr(obj, attr_name)
@@ -124,7 +124,7 @@ class StubOutForTesting:
if isinstance(old_attribute, staticmethod):
old_child = staticmethod(old_child)
elif isinstance(old_attribute, classmethod):
- old_child = classmethod(old_child.im_func)
+ old_child = classmethod(old_child.__func__)
self.cache.append((parent, old_child, child_name))
setattr(parent, child_name, new_child)