summaryrefslogtreecommitdiff
path: root/stubout.py
diff options
context:
space:
mode:
Diffstat (limited to 'stubout.py')
-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)