mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +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
|
@ -12,18 +12,18 @@ def main():
|
|||
try:
|
||||
f = open(filename, 'r')
|
||||
except IOError as msg:
|
||||
print filename, ': can\'t open :', msg
|
||||
print(filename, ': can\'t open :', msg)
|
||||
continue
|
||||
line = f.readline()
|
||||
if not re.match('^#! */usr/local/bin/python', line):
|
||||
print filename, ': not a /usr/local/bin/python script'
|
||||
print(filename, ': not a /usr/local/bin/python script')
|
||||
f.close()
|
||||
continue
|
||||
rest = f.read()
|
||||
f.close()
|
||||
line = re.sub('/usr/local/bin/python',
|
||||
'/usr/bin/env python', line)
|
||||
print filename, ':', repr(line)
|
||||
print(filename, ':', repr(line))
|
||||
f = open(filename, "w")
|
||||
f.write(line)
|
||||
f.write(rest)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue