summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrzemyslaw Gajda <quermit@gmail.com>2012-04-23 22:54:44 +0200
committerPrzemyslaw Gajda <quermit@gmail.com>2012-04-23 22:54:44 +0200
commit557578961290cb9adf98866565a0f9d540a8d797 (patch)
tree2167f59fa3760c8bdb24bb552efcda71f7284e31
parent4adacddee307c4f90d8cb49ca69f83176967a4e7 (diff)
downloadpymox-557578961290cb9adf98866565a0f9d540a8d797.tar.gz
Restored callable function since it's present in python 3.2
-rwxr-xr-xmox.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/mox.py b/mox.py
index 595a133..4cd8bf4 100755
--- a/mox.py
+++ b/mox.py
@@ -74,10 +74,6 @@ import collections
import stubout
-def _callable(obj):
- return isinstance(obj, collections.Callable)
-
-
class Error(AssertionError):
"""Base exception for this module."""
@@ -577,7 +573,7 @@ class MockObject(MockAnything):
for method in dir(class_to_mock):
attr = getattr(class_to_mock, method)
- if _callable(attr):
+ if callable(attr):
self._known_methods.add(method)
elif not (type(attr) is property):
# treating properties as class vars makes little sense.
@@ -2019,7 +2015,7 @@ class MoxMetaTestBase(type):
d[attr_name] = getattr(base, attr_name)
for func_name, func in d.items():
- if func_name.startswith('test') and _callable(func):
+ if func_name.startswith('test') and callable(func):
setattr(cls, func_name, MoxMetaTestBase.CleanUpTest(cls, func))