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/pydoc.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/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index c496d1d..63bd2f7 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1480,7 +1480,7 @@ def doc(thing, title='Python Library Documentation: %s', forceload=0): desc += ' object' pager(title % desc + '\n\n' + text.document(object, name)) except (ImportError, ErrorDuringImport) as value: - print value + print(value) def writedoc(thing, forceload=0): """Write HTML documentation to a file in the current directory.""" @@ -1490,9 +1490,9 @@ def writedoc(thing, forceload=0): file = open(name + '.html', 'w') file.write(page) file.close() - print 'wrote', name + '.html' + print('wrote', name + '.html') except (ImportError, ErrorDuringImport) as value: - print value + print(value) def writedocs(dir, pkgpath='', done=None): """Write out HTML documentation for all modules in a directory tree.""" @@ -1883,7 +1883,7 @@ def apropos(key): def callback(path, modname, desc): if modname[-9:] == '.__init__': modname = modname[:-9] + ' (package)' - print modname, desc and '- ' + desc + print(modname, desc and '- ' + desc) try: import warnings except ImportError: pass else: warnings.filterwarnings('ignore') # ignore problems during import @@ -2200,9 +2200,9 @@ def cli(): except ValueError: raise BadUsage def ready(server): - print 'pydoc server ready at %s' % server.url + print('pydoc server ready at %s' % server.url) def stopped(): - print 'pydoc server stopped' + print('pydoc server stopped') serve(port, ready, stopped) return if opt == '-w': @@ -2211,7 +2211,7 @@ def cli(): if not args: raise BadUsage for arg in args: if ispath(arg) and not os.path.exists(arg): - print 'file %r does not exist' % arg + print('file %r does not exist' % arg) break try: if ispath(arg) and os.path.isfile(arg): @@ -2224,11 +2224,11 @@ def cli(): else: help.help(arg) except ErrorDuringImport as value: - print value + print(value) except (getopt.error, BadUsage): cmd = os.path.basename(sys.argv[0]) - print """pydoc - the Python documentation tool + print("""pydoc - the Python documentation tool %s <name> ... Show text documentation on something. <name> may be the name of a @@ -2251,6 +2251,6 @@ def cli(): Write out the HTML documentation for a module to a file in the current directory. If <name> contains a '%s', it is treated as a filename; if it names a directory, documentation is written for all the contents. -""" % (cmd, os.sep, cmd, cmd, cmd, cmd, os.sep) +""" % (cmd, os.sep, cmd, cmd, cmd, cmd, os.sep)) if __name__ == '__main__': cli() |