diff options
author | Guido van Rossum <guido@python.org> | 2007-02-09 05:37:30 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-02-09 05:37:30 (GMT) |
commit | be19ed77ddb047e02fe94d142181062af6d99dcc (patch) | |
tree | 70f214e06554046fcccbadeb78665f25e07ce965 /Lib/test/test_import.py | |
parent | 452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff) | |
download | cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.zip cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.bz2 |
Fix most trivially-findable print statements.
There's one major and one minor category still unfixed:
doctests are the major category (and I hope to be able to augment the
refactoring tool to refactor bona fide doctests soon);
other code generating print statements in strings is the minor category.
(Oh, and I don't know if the compiler package works.)
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r-- | Lib/test/test_import.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index f3d1d49..a8f912f 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -45,11 +45,11 @@ class ImportTest(unittest.TestCase): pyc = TESTFN + os.extsep + "pyc" f = open(source, "w") - print >> f, "# This tests Python's ability to import a", ext, "file." + print("# This tests Python's ability to import a", ext, "file.", file=f) a = random.randrange(1000) b = random.randrange(1000) - print >> f, "a =", a - print >> f, "b =", b + print("a =", a, file=f) + print("b =", b, file=f) f.close() try: @@ -130,7 +130,7 @@ class ImportTest(unittest.TestCase): def test_failing_import_sticks(self): source = TESTFN + os.extsep + "py" f = open(source, "w") - print >> f, "a = 1/0" + print("a = 1/0", file=f) f.close() # New in 2.4, we shouldn't be able to import that no matter how often @@ -153,8 +153,8 @@ class ImportTest(unittest.TestCase): # A failing reload should leave the module object in sys.modules. source = TESTFN + os.extsep + "py" f = open(source, "w") - print >> f, "a = 1" - print >> f, "b = 2" + print("a = 1", file=f) + print("b = 2", file=f) f.close() sys.path.insert(0, os.curdir) @@ -172,8 +172,8 @@ class ImportTest(unittest.TestCase): # Now damage the module. f = open(source, "w") - print >> f, "a = 10" - print >> f, "b = 20//0" + print("a = 10", file=f) + print("b = 20//0", file=f) f.close() self.assertRaises(ZeroDivisionError, reload, mod) |