diff options
author | Duncan McGreggor <duncan@canonical.com> | 2009-02-13 05:49:02 -0600 |
---|---|---|
committer | Duncan McGreggor <duncan@canonical.com> | 2009-02-13 05:49:02 -0600 |
commit | 44c1f801a3068647673c7e827827bab7cc72264c (patch) | |
tree | 055452bee51cdcdcf7b01bc8da07fbf975f0d404 /mocker.py | |
parent | 8a4227cfcc32fed041462ebf6031d722bb0c39a1 (diff) | |
download | mocker-44c1f801a3068647673c7e827827bab7cc72264c.tar.gz |
- Added a new unit test to check for a bug in mocker where the original
attribute gets swallowed by a subsequent exception check.
- Added a fix for the bug.
Diffstat (limited to 'mocker.py')
-rw-r--r-- | mocker.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2020,6 +2020,7 @@ class Patcher(Task): try: return unpatched(*action.args, **action.kwargs) except AttributeError: + (type, value, traceback) = sys.exc_info() if action.kind == "getattr": # The normal behavior of Python is to try __getattribute__, # and if it raises AttributeError, try __getattr__. We've @@ -2031,7 +2032,7 @@ class Patcher(Task): pass else: return __getattr__(*action.args, **action.kwargs) - raise + raise type, value, traceback class PatchedMethod(object): |