fetch code object compatibly

--HG--
branch : trunk
This commit is contained in:
Benjamin Peterson 2010-04-23 20:43:49 -05:00
parent d1b45ef3d4
commit 1771cb0af8
1 changed files with 1 additions and 1 deletions

View File

@ -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)