Commit 47172b4f authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

[Bug #724767] crlf.py uses the variable name file, which it shouldn't anymore.

parent c85bf582
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
"Replace CRLF with LF in argument files. Print names of changed files." "Replace CRLF with LF in argument files. Print names of changed files."
import sys, os import sys, os
for file in sys.argv[1:]: for filename in sys.argv[1:]:
if os.path.isdir(file): if os.path.isdir(filename):
print file, "Directory!" print filename, "Directory!"
continue continue
data = open(file, "rb").read() data = open(filename, "rb").read()
if '\0' in data: if '\0' in data:
print file, "Binary!" print filename, "Binary!"
continue continue
newdata = data.replace("\r\n", "\n") newdata = data.replace("\r\n", "\n")
if newdata != data: if newdata != data:
print file print filename
f = open(file, "wb") f = open(filename, "wb")
f.write(newdata) f.write(newdata)
f.close() f.close()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment