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.)
diff --git a/Lib/test/test_getopt.py b/Lib/test/test_getopt.py
index f565d23..10bd256 100644
--- a/Lib/test/test_getopt.py
+++ b/Lib/test/test_getopt.py
@@ -21,14 +21,14 @@
del os.environ["POSIXLY_CORRECT"]
if verbose:
- print 'Running tests on getopt.short_has_arg'
+ print('Running tests on getopt.short_has_arg')
verify(getopt.short_has_arg('a', 'a:'))
verify(not getopt.short_has_arg('a', 'a'))
expectException("tmp = getopt.short_has_arg('a', 'b')", GetoptError)
expectException("tmp = getopt.short_has_arg('a', '')", GetoptError)
if verbose:
- print 'Running tests on getopt.long_has_args'
+ print('Running tests on getopt.long_has_args')
has_arg, option = getopt.long_has_args('abc', ['abc='])
verify(has_arg)
verify(option == 'abc')
@@ -47,7 +47,7 @@
GetoptError)
if verbose:
- print 'Running tests on getopt.do_shorts'
+ print('Running tests on getopt.do_shorts')
opts, args = getopt.do_shorts([], 'a', 'a', [])
verify(opts == [('-a', '')])
verify(args == [])
@@ -69,7 +69,7 @@
GetoptError)
if verbose:
- print 'Running tests on getopt.do_longs'
+ print('Running tests on getopt.do_longs')
opts, args = getopt.do_longs([], 'abc', ['abc'], [])
verify(opts == [('--abc', '')])
verify(args == [])
@@ -99,7 +99,7 @@
'--beta', 'arg1', 'arg2']
if verbose:
- print 'Running tests on getopt.getopt'
+ print('Running tests on getopt.getopt')
opts, args = getopt.getopt(cmdline, 'a:b', ['alpha=', 'beta'])
verify(opts == [('-a', '1'), ('-b', ''), ('--alpha', '2'), ('--beta', ''),
('-a', '3'), ('-a', ''), ('--beta', '')] )
@@ -113,7 +113,7 @@
# Test handling of GNU style scanning mode.
if verbose:
- print 'Running tests on getopt.gnu_getopt'
+ print('Running tests on getopt.gnu_getopt')
cmdline = ['-a', 'arg1', '-b', '1', '--alpha', '--beta=2']
# GNU style
opts, args = getopt.gnu_getopt(cmdline, 'ab:', ['alpha', 'beta='])
@@ -177,4 +177,4 @@
#------------------------------------------------------------------------------
if verbose:
- print "Module getopt: tests completed successfully."
+ print("Module getopt: tests completed successfully.")