mirror of
https://github.com/python/cpython.git
synced 2025-07-12 22:05:16 +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
|
@ -171,11 +171,11 @@ def parsedir(dir, modify):
|
|||
fp = open(fn)
|
||||
m = ErrorMessage(fp)
|
||||
sender = m.getaddr('From')
|
||||
print '%s\t%-40s\t'%(fn, sender[1]),
|
||||
print('%s\t%-40s\t'%(fn, sender[1]), end=' ')
|
||||
|
||||
if m.is_warning():
|
||||
fp.close()
|
||||
print 'warning only'
|
||||
print('warning only')
|
||||
nwarn = nwarn + 1
|
||||
if modify:
|
||||
os.rename(fn, ','+fn)
|
||||
|
@ -185,11 +185,11 @@ def parsedir(dir, modify):
|
|||
try:
|
||||
errors = m.get_errors()
|
||||
except Unparseable:
|
||||
print '** Not parseable'
|
||||
print('** Not parseable')
|
||||
nbad = nbad + 1
|
||||
fp.close()
|
||||
continue
|
||||
print len(errors), 'errors'
|
||||
print(len(errors), 'errors')
|
||||
|
||||
# Remember them
|
||||
for e in errors:
|
||||
|
@ -211,16 +211,16 @@ def parsedir(dir, modify):
|
|||
os.rename(fn, ','+fn)
|
||||
## os.unlink(fn)
|
||||
|
||||
print '--------------'
|
||||
print nok, 'files parsed,',nwarn,'files warning-only,',
|
||||
print nbad,'files unparseable'
|
||||
print '--------------'
|
||||
print('--------------')
|
||||
print(nok, 'files parsed,',nwarn,'files warning-only,', end=' ')
|
||||
print(nbad,'files unparseable')
|
||||
print('--------------')
|
||||
list = []
|
||||
for e in errordict.keys():
|
||||
list.append((errordict[e], errorfirst[e], errorlast[e], e))
|
||||
list.sort()
|
||||
for num, first, last, e in list:
|
||||
print '%d %s - %s\t%s' % (num, first, last, e)
|
||||
print('%d %s - %s\t%s' % (num, first, last, e))
|
||||
|
||||
def main():
|
||||
modify = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue