summaryrefslogtreecommitdiff
path: root/mox.py
diff options
context:
space:
mode:
Diffstat (limited to 'mox.py')
-rwxr-xr-xmox.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/mox.py b/mox.py
index 5739ab1..2ffdf90 100755
--- a/mox.py
+++ b/mox.py
@@ -913,7 +913,17 @@ class MethodSignatureChecker(object):
# Check if the param is an instance of the expected class,
# or check equality (useful for checking Comparators).
- if isinstance(params[0], expected) or params[0] == expected:
+
+ # This is a hack to work around the fact that the first
+ # parameter can be a Comparator, and the comparison may raise
+ # an exception during this comparison, which is OK.
+ try:
+ param_equality = (params[0] == expected)
+ except:
+ param_equality = False;
+
+
+ if isinstance(params[0], expected) or param_equality:
params = params[1:]
# If the IsA() comparator is being used, we need to check the
# inverse of the usual case - that the given instance is a subclass