mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
Convert print statements to function calls in Tools/.
This commit is contained in:
parent
e5d0e8431f
commit
6afaeb757a
66 changed files with 777 additions and 779 deletions
|
@ -28,8 +28,8 @@ except:
|
|||
pysource = pysource()
|
||||
|
||||
|
||||
print >>sys.stderr, ("The pysource module is not available; "
|
||||
"no sophisticated Python source file search will be done.")
|
||||
print("The pysource module is not available; "
|
||||
"no sophisticated Python source file search will be done.", file=sys.stderr)
|
||||
|
||||
|
||||
decl_re = re.compile(r"coding[=:]\s*([-\w.]+)")
|
||||
|
@ -79,8 +79,8 @@ usage = """Usage: %s [-cd] paths...
|
|||
try:
|
||||
opts, args = getopt.getopt(sys.argv[1:], 'cd')
|
||||
except getopt.error as msg:
|
||||
print >>sys.stderr, msg
|
||||
print >>sys.stderr, usage
|
||||
print(msg, file=sys.stderr)
|
||||
print(usage, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
is_python = pysource.looks_like_python
|
||||
|
@ -93,12 +93,12 @@ for o, a in opts:
|
|||
debug = True
|
||||
|
||||
if not args:
|
||||
print >>sys.stderr, usage
|
||||
print(usage, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
for fullpath in pysource.walk_python_files(args, is_python):
|
||||
if debug:
|
||||
print "Testing for coding: %s" % fullpath
|
||||
print("Testing for coding: %s" % fullpath)
|
||||
result = needs_declaration(fullpath)
|
||||
if result:
|
||||
print fullpath
|
||||
print(fullpath)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue