diff options
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 #======================================================================= |