[py-svn] r9328 - py/dist/py/code
hpk at codespeak.net
hpk at codespeak.net
Sat Feb 19 13:38:43 CET 2005
Author: hpk
Date: Sat Feb 19 13:38:42 2005
New Revision: 9328
Modified:
py/dist/py/code/source.py
Log:
accept one more argument to be compatible with CPython
Modified: py/dist/py/code/source.py
==============================================================================
--- py/dist/py/code/source.py (original)
+++ py/dist/py/code/source.py Sat Feb 19 13:38:42 2005
@@ -1,6 +1,7 @@
from __future__ import generators
import sys
import inspect
+cpy_compile = compile
# DON'T IMPORT PY HERE
@@ -165,7 +166,7 @@
return "\n".join(self.lines)
def compile(self, filename=None, mode='exec',
- flag=generators.compiler_flag):
+ flag=generators.compiler_flag, dont_inherit=0):
""" return compiled code object. if filename is None
invent an artificial filename which displays
the source/line position of the caller frame.
@@ -176,7 +177,7 @@
frame.f_lineno)
source = str(self)+'\n'
try:
- co = compile(source, filename, mode, flag)
+ co = cpy_compile(source, filename, mode, flag)
except SyntaxError, ex:
# re-represent syntax errors from parsing python strings
newex = SyntaxError('\n'.join([
@@ -197,7 +198,7 @@
#
def compile_(source, filename=None, mode='exec', flags=
- generators.compiler_flag):
+ generators.compiler_flag, dont_inherit=0):
""" compile the given source to a raw code object,
which points back to the source code through
"co_filename.__source__". All code objects
More information about the pytest-commit
mailing list