diff --git a/py/_plugin/pytest_terminal.py b/py/_plugin/pytest_terminal.py index f67dfacb4..1e1751b85 100644 --- a/py/_plugin/pytest_terminal.py +++ b/py/_plugin/pytest_terminal.py @@ -505,7 +505,7 @@ class ShowFuncargSession(Session): def getlocation(self, function): import inspect fn = py.path.local(inspect.getfile(function)) - lineno = function.func_code.co_firstlineno + lineno = py.builtin._getcode(function).co_firstlineno if fn.relto(self.fspath): fn = fn.relto(self.fspath) return "%s:%d" %(fn, lineno+1)