diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-09-17 21:31:35 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-09-17 21:31:35 (GMT) |
commit | 5d1e34aa4217f1c3526e2dc330c84bf836c696b8 (patch) | |
tree | 0418bcc146fdae809b3d07234666628adea00fc9 /Tools/compiler | |
parent | 9dca36432e4526da9c5885e86782e7dfa5432c42 (diff) | |
download | cpython-5d1e34aa4217f1c3526e2dc330c84bf836c696b8.zip cpython-5d1e34aa4217f1c3526e2dc330c84bf836c696b8.tar.gz cpython-5d1e34aa4217f1c3526e2dc330c84bf836c696b8.tar.bz2 |
Track changes to compiler API
Diffstat (limited to 'Tools/compiler')
-rw-r--r-- | Tools/compiler/compile.py | 10 | ||||
-rw-r--r-- | Tools/compiler/regrtest.py | 14 |
2 files changed, 15 insertions, 9 deletions
diff --git a/Tools/compiler/compile.py b/Tools/compiler/compile.py index 1a843e2..c90d851 100644 --- a/Tools/compiler/compile.py +++ b/Tools/compiler/compile.py @@ -1,7 +1,7 @@ import sys import getopt -from compiler import compile, visitor +from compiler import compileFile, visitor import profile @@ -35,14 +35,16 @@ def main(): print filename try: if PROFILE: - profile.run('compile(%s, %s)' % (`filename`, `DISPLAY`), + profile.run('compileFile(%s, %s)' % (`filename`, + `DISPLAY`), filename + ".prof") else: - compile(filename, DISPLAY) + compileFile(filename, DISPLAY) except SyntaxError, err: print err - print err.lineno + if err.lineno is not None: + print err.lineno if not CONTINUE: sys.exit(-1) diff --git a/Tools/compiler/regrtest.py b/Tools/compiler/regrtest.py index 1425518..aae0ec2 100644 --- a/Tools/compiler/regrtest.py +++ b/Tools/compiler/regrtest.py @@ -7,7 +7,7 @@ The regression test is run with the interpreter in verbose mode so that import problems can be observed easily. """ -from compiler import compile +from compiler import compileFile import os import sys @@ -25,12 +25,13 @@ def copy_library(): dest = tempfile.mktemp() os.mkdir(dest) libdir = os.path.split(test.__path__[0])[0] - os.system("cp -r %s/* %s" % (libdir, dest)) + print "Found standard library in", libdir print "Creating copy of standard library in", dest + os.system("cp -r %s/* %s" % (libdir, dest)) return dest def compile_files(dir): - print "Compiling", dir + print "Compiling", dir, "\n\t", line_len = 10 for file in os.listdir(dir): base, ext = os.path.splitext(file) @@ -42,7 +43,7 @@ def compile_files(dir): line_len = len(source) + 9 print file, try: - compile(source) + compileFile(source) except SyntaxError, err: print err continue @@ -52,13 +53,16 @@ def compile_files(dir): path = os.path.join(dir, file) if os.path.isdir(path): print + print compile_files(path) + print "\t", + line_len = 10 print def run_regrtest(lib_dir): test_dir = os.path.join(lib_dir, "test") os.chdir(test_dir) - os.system("PYTHONPATH=%s %s -v regrtest.py -r" % (lib_dir, sys.executable)) + os.system("PYTHONPATH=%s %s -v regrtest.py" % (lib_dir, sys.executable)) def cleanup(dir): os.system("rm -rf %s" % dir) |