[py-svn] r10382 - py/branch/py-collect/code
hpk at codespeak.net
hpk at codespeak.net
Thu Apr 7 00:18:47 CEST 2005
Author: hpk
Date: Thu Apr 7 00:18:47 2005
New Revision: 10382
Modified:
py/branch/py-collect/code/frame.py
Log:
the underlying code object is an implementation detail ...
(consider IronPython or Jython which have a different
code object model)
Modified: py/branch/py-collect/code/frame.py
==============================================================================
--- py/branch/py-collect/code/frame.py (original)
+++ py/branch/py-collect/code/frame.py Thu Apr 7 00:18:47 2005
@@ -4,7 +4,7 @@
def __init__(self, f_code):
f_code = getattr(f_code, 'im_func', f_code)
f_code = getattr(f_code, 'func_code', f_code)
- self.raw = f_code
+ self._raw = f_code
try:
self.firstlineno = f_code.co_firstlineno - 1
except AttributeError:
@@ -13,22 +13,22 @@
def path(self):
try:
- return self.raw.co_filename.__path__
+ return self._raw.co_filename.__path__
except AttributeError:
try:
- return py.path.local(self.raw.co_filename)
+ return py.path.local(self._raw.co_filename)
except ValueError:
return None
- path = property(path, None, None, "path of this code object")
+ path = property(path, None, None, "path to source of this code object")
def fullsource(self):
- fn = self.raw.co_filename
+ fn = self._raw.co_filename
try:
return fn.__source__
except AttributeError:
return py.code.Source(self.path.read(mode="rU"))
fullsource = property(fullsource, None, None,
- "full source containing this code object")
+ "full source representing this code object")
class Frame(object):
More information about the pytest-commit
mailing list