[svn r60141] refactor things such that all fallbacks to inspect.get/findsource happen in helpers in source.py

--HG--
branch : trunk
This commit is contained in:
pedronis
2008-11-25 19:34:47 +01:00
parent 5c8b04dacb
commit 1a150e9050
6 changed files with 71 additions and 23 deletions

View File

@@ -18,6 +18,7 @@ a tree of collectors and test items that this modules provides::
"""
import py
from py.__.test.collect import configproperty, warnoldcollect
from py.__.code.source import findsource
class PyobjMixin(object):
def obj():
@@ -68,7 +69,7 @@ class PyobjMixin(object):
fspath = fn and py.path.local(fn) or None
if fspath:
try:
lines, lineno = py.std.inspect.findsource(self.obj)
_, lineno = findsource(self.obj)
except IOError:
lineno = None
else: