Fix bug when reporting error

This commit is contained in:
Guido van Rossum 1992-12-10 00:01:24 +00:00
parent 15f27fb6ea
commit cf5dd9cbfd
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
#! /ufs/guido/bin/sgi/python #! /ufs/guido/bin/sgi/python
#! /usr/local/python #! /usr/local/bin/python
# Fix Python source files to use the new class definition syntax, i.e., # Fix Python source files to use the new class definition syntax, i.e.,
# class C() = base(), base(), ...: ... # class C() = base(), base(), ...: ...
@ -38,7 +38,7 @@ rep = sys.stdout.write
def main(): def main():
bad = 0 bad = 0
if not sys.argv[1:]: # No arguments if not sys.argv[1:]: # No arguments
err('usage: ' + argv[0] + ' file-or-directory ...\n') err('usage: ' + sys.argv[0] + ' file-or-directory ...\n')
sys.exit(2) sys.exit(2)
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
if os.path.isdir(arg): if os.path.isdir(arg):

View File

@ -12,7 +12,7 @@ def main():
try: try:
f = open(file, 'r+') f = open(file, 'r+')
except IOError: except IOError:
print f, ': can\'t open for update' print file, ': can\'t open for update'
continue continue
line = f.readline() line = f.readline()
if regex.match('^#! */usr/local/python', line) < 0: if regex.match('^#! */usr/local/python', line) < 0: