summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/fixheader.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2003-05-13 18:14:25 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2003-05-13 18:14:25 (GMT)
commitac6df95d07aa3951f8bfc6febce132e09850db73 (patch)
tree5bc66133d5d093e099b622ac3cd35e216f60a389 /Tools/scripts/fixheader.py
parentbf1bef820c5af6b0a9a60abe1564ac35f036fdcb (diff)
downloadcpython-ac6df95d07aa3951f8bfc6febce132e09850db73.zip
cpython-ac6df95d07aa3951f8bfc6febce132e09850db73.tar.gz
cpython-ac6df95d07aa3951f8bfc6febce132e09850db73.tar.bz2
Fix use of 'file' as a variable name.
(I've tested the fixes, but please proofread anyway.)
Diffstat (limited to 'Tools/scripts/fixheader.py')
-rwxr-xr-xTools/scripts/fixheader.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Tools/scripts/fixheader.py b/Tools/scripts/fixheader.py
index 1f9c713..02b4f3b 100755
--- a/Tools/scripts/fixheader.py
+++ b/Tools/scripts/fixheader.py
@@ -6,28 +6,28 @@ import sys
def main():
args = sys.argv[1:]
- for file in args:
- process(file)
+ for filename in args:
+ process(filename)
-def process(file):
+def process(filename):
try:
- f = open(file, 'r')
+ f = open(filename, 'r')
except IOError, msg:
- sys.stderr.write('%s: can\'t open: %s\n' % (file, str(msg)))
+ sys.stderr.write('%s: can\'t open: %s\n' % (filename, str(msg)))
return
data = f.read()
f.close()
if data[:2] <> '/*':
- sys.stderr.write('%s does not begin with C comment\n' % file)
+ sys.stderr.write('%s does not begin with C comment\n' % filename)
return
try:
- f = open(file, 'w')
+ f = open(filename, 'w')
except IOError, msg:
- sys.stderr.write('%s: can\'t write: %s\n' % (file, str(msg)))
+ sys.stderr.write('%s: can\'t write: %s\n' % (filename, str(msg)))
return
- sys.stderr.write('Processing %s ...\n' % file)
+ sys.stderr.write('Processing %s ...\n' % filename)
magic = 'Py_'
- for c in file:
+ for c in filename:
if ord(c)<=0x80 and c.isalnum():
magic = magic + c.upper()
else: magic = magic + '_'