From 04d68fbc9e53ff01962ed5da8686ced276425c95 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 15 Nov 2019 15:51:44 +0200 Subject: [PATCH] Remove checks for Python2-only fields im_func and func_code --- src/_pytest/_code/code.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index 3c2acfe7f..19d5efaa6 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -1054,8 +1054,6 @@ def getrawcode(obj, trycall=True): try: return obj.__code__ except AttributeError: - obj = getattr(obj, "im_func", obj) - obj = getattr(obj, "func_code", obj) obj = getattr(obj, "f_code", obj) obj = getattr(obj, "__code__", obj) if trycall and not hasattr(obj, "co_firstlineno"):