summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3/tests/pytree_idempotency.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-03-19 05:33:36 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-03-19 05:33:36 (GMT)
commit8a5f8ca33b56db9af973d1f34a9b3df5271b56c0 (patch)
tree55b17647085ff8b679f2bea803545884148c66e4 /Lib/lib2to3/tests/pytree_idempotency.py
parentf733c60d9aea123a46cd41dbe4dedee7aa2f20f3 (diff)
downloadcpython-8a5f8ca33b56db9af973d1f34a9b3df5271b56c0.zip
cpython-8a5f8ca33b56db9af973d1f34a9b3df5271b56c0.tar.gz
cpython-8a5f8ca33b56db9af973d1f34a9b3df5271b56c0.tar.bz2
Run 2to3 on this library.
Diffstat (limited to 'Lib/lib2to3/tests/pytree_idempotency.py')
-rwxr-xr-xLib/lib2to3/tests/pytree_idempotency.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/lib2to3/tests/pytree_idempotency.py b/Lib/lib2to3/tests/pytree_idempotency.py
index d83f5cc..ca5441a 100755
--- a/Lib/lib2to3/tests/pytree_idempotency.py
+++ b/Lib/lib2to3/tests/pytree_idempotency.py
@@ -28,7 +28,7 @@ def main():
fn = "example.py"
tree = dr.parse_file(fn, debug=True)
if not diff(fn, tree):
- print "No diffs."
+ print("No diffs.")
if not sys.argv[1:]:
return # Pass a dummy argument to run the complete test suite below
@@ -44,7 +44,7 @@ def main():
fn = fn[:-1]
if not fn.endswith(".py"):
continue
- print >>sys.stderr, "Parsing", fn
+ print("Parsing", fn, file=sys.stderr)
tree = dr.parse_file(fn, debug=True)
if diff(fn, tree):
problems.append(fn)
@@ -55,27 +55,27 @@ def main():
names = os.listdir(dir)
except os.error:
continue
- print >>sys.stderr, "Scanning", dir, "..."
+ print("Scanning", dir, "...", file=sys.stderr)
for name in names:
if not name.endswith(".py"):
continue
- print >>sys.stderr, "Parsing", name
+ print("Parsing", name, file=sys.stderr)
fn = os.path.join(dir, name)
try:
tree = dr.parse_file(fn, debug=True)
- except pgen2.parse.ParseError, err:
- print "ParseError:", err
+ except pgen2.parse.ParseError as err:
+ print("ParseError:", err)
else:
if diff(fn, tree):
problems.append(fn)
# Show summary of problem files
if not problems:
- print "No problems. Congratulations!"
+ print("No problems. Congratulations!")
else:
- print "Problems in following files:"
+ print("Problems in following files:")
for fn in problems:
- print "***", fn
+ print("***", fn)
def diff(fn, tree):
f = open("@", "w")