summaryrefslogtreecommitdiffstats
path: root/Lib/modulefinder.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
commitbe19ed77ddb047e02fe94d142181062af6d99dcc (patch)
tree70f214e06554046fcccbadeb78665f25e07ce965 /Lib/modulefinder.py
parent452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff)
downloadcpython-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/modulefinder.py')
-rw-r--r--Lib/modulefinder.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py
index 04c9abf..5145f72 100644
--- a/Lib/modulefinder.py
+++ b/Lib/modulefinder.py
@@ -89,11 +89,11 @@ class ModuleFinder:
def msg(self, level, str, *args):
if level <= self.debug:
for i in range(self.indent):
- print " ",
- print str,
+ print(" ", end=' ')
+ print(str, end=' ')
for arg in args:
- print repr(arg),
- print
+ print(repr(arg), end=' ')
+ print()
def msgin(self, *args):
level = args[0]
@@ -482,38 +482,38 @@ class ModuleFinder:
"""Print a report to stdout, listing the found modules with their
paths, as well as modules that are missing, or seem to be missing.
"""
- print
- print " %-25s %s" % ("Name", "File")
- print " %-25s %s" % ("----", "----")
+ print()
+ print(" %-25s %s" % ("Name", "File"))
+ print(" %-25s %s" % ("----", "----"))
# Print modules found
keys = self.modules.keys()
keys.sort()
for key in keys:
m = self.modules[key]
if m.__path__:
- print "P",
+ print("P", end=' ')
else:
- print "m",
- print "%-25s" % key, m.__file__ or ""
+ print("m", end=' ')
+ print("%-25s" % key, m.__file__ or "")
# Print missing modules
missing, maybe = self.any_missing_maybe()
if missing:
- print
- print "Missing modules:"
+ print()
+ print("Missing modules:")
for name in missing:
mods = self.badmodules[name].keys()
mods.sort()
- print "?", name, "imported from", ', '.join(mods)
+ print("?", name, "imported from", ', '.join(mods))
# Print modules that may be missing, but then again, maybe not...
if maybe:
- print
- print "Submodules thay appear to be missing, but could also be",
- print "global names in the parent package:"
+ print()
+ print("Submodules thay appear to be missing, but could also be", end=' ')
+ print("global names in the parent package:")
for name in maybe:
mods = self.badmodules[name].keys()
mods.sort()
- print "?", name, "imported from", ', '.join(mods)
+ print("?", name, "imported from", ', '.join(mods))
def any_missing(self):
"""Return a list of modules that appear to be missing. Use
@@ -603,7 +603,7 @@ def test():
try:
opts, args = getopt.getopt(sys.argv[1:], "dmp:qx:")
except getopt.error as msg:
- print msg
+ print(msg)
return
# Process options
@@ -634,9 +634,9 @@ def test():
path[0] = os.path.dirname(script)
path = addpath + path
if debug > 1:
- print "path:"
+ print("path:")
for item in path:
- print " ", repr(item)
+ print(" ", repr(item))
# Create the module finder and turn its crank
mf = ModuleFinder(path, debug, exclude)
@@ -660,4 +660,4 @@ if __name__ == '__main__':
try:
mf = test()
except KeyboardInterrupt:
- print "\n[interrupt]"
+ print("\n[interrupt]")