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_support.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_support.py')
-rw-r--r-- | Lib/test/test_support.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 0b37306..6cc52ea 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -106,8 +106,7 @@ def bind_port(sock, host='', preferred_port=54321): (err, msg) = e if err != errno.EADDRINUSE: raise - print >>sys.__stderr__, \ - ' WARNING: failed to listen on port %d, trying another' % port + print(' WARNING: failed to listen on port %d, trying another' % port, file=sys.__stderr__) raise TestFailed, 'unable to find port to listen on' FUZZ = 1e-6 @@ -178,10 +177,9 @@ else: except UnicodeEncodeError: pass else: - print \ - 'WARNING: The filename %r CAN be encoded by the filesystem. ' \ + print('WARNING: The filename %r CAN be encoded by the filesystem. ' \ 'Unicode filename tests may not be effective' \ - % TESTFN_UNICODE_UNENCODEABLE + % TESTFN_UNICODE_UNENCODEABLE) # Make sure we can write to TESTFN, try in /tmp if we can't fp = None @@ -194,8 +192,8 @@ except IOError: TESTFN = TMP_TESTFN del TMP_TESTFN except IOError: - print ('WARNING: tests will fail, unable to write to: %s or %s' % - (TESTFN, TMP_TESTFN)) + print(('WARNING: tests will fail, unable to write to: %s or %s' % + (TESTFN, TMP_TESTFN))) if fp is not None: fp.close() unlink(TESTFN) @@ -267,7 +265,7 @@ def open_urlresource(url): return open(fn) requires('urlfetch') - print >> get_original_stdout(), '\tfetching %s ...' % url + print('\tfetching %s ...' % url, file=get_original_stdout()) fn, _ = urllib.urlretrieve(url, filename) return open(fn) @@ -514,7 +512,7 @@ def run_doctest(module, verbosity=None): finally: sys.stdout = save_stdout if verbose: - print 'doctest (%s) ... %d tests with zero failures' % (module.__name__, t) + print('doctest (%s) ... %d tests with zero failures' % (module.__name__, t)) return f, t #======================================================================= |