]> granicus.if.org Git - python/commitdiff
unittest.mock: removed another bit of Python 2 only code
authorMichael Foord <michael@voidspace.org.uk>
Sun, 25 Mar 2012 22:27:12 +0000 (23:27 +0100)
committerMichael Foord <michael@voidspace.org.uk>
Sun, 25 Mar 2012 22:27:12 +0000 (23:27 +0100)
Lib/unittest/mock.py

index 5688af3d506a0849486e1de013cd81da486c4e74..a45a7a83fbc74b06a0f129a286addf2368299c55 100644 (file)
@@ -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