From: Michael Foord Date: Sun, 25 Mar 2012 22:27:12 +0000 (+0100) Subject: unittest.mock: removed another bit of Python 2 only code X-Git-Tag: v3.3.0a2~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0340ea77d1c7443b6df5a1fdbf0c33110230a12e;p=python unittest.mock: removed another bit of Python 2 only code --- diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 5688af3d50..a45a7a83fb 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -1086,12 +1086,6 @@ class _patch(object): patching.__exit__(*exc_info) patched.patchings = [self] - if hasattr(func, 'func_code'): - # not in Python 3 - patched.compat_co_firstlineno = getattr( - func, "compat_co_firstlineno", - func.func_code.co_firstlineno - ) return patched