diff options
author | Przemyslaw Gajda <quermit@gmail.com> | 2012-04-23 00:13:21 +0200 |
---|---|---|
committer | Przemyslaw Gajda <quermit@gmail.com> | 2012-04-23 00:13:21 +0200 |
commit | 7de1beb8c8d47f43d6645430e2b3dca2c3aa19a8 (patch) | |
tree | b65d4fad174de74bce5308293aa2f87fe58fa85c | |
parent | b13fe45f54ce81cf79286e7eee8e3dfbe96023b3 (diff) | |
download | pymox-7de1beb8c8d47f43d6645430e2b3dca2c3aa19a8.tar.gz |
Fixed compatiblity issues in stubout
-rw-r--r-- | stubout.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |