Skip to content

Commit 87ddce1

Browse files
committed
[Bug #724767] Avoid use of 'file' as a variable name
1 parent 2398d57 commit 87ddce1

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎Tools/scripts/lfcr.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
"Replace LF with CRLF in argument files. Print names of changed files."
44

55
import sys, re, os
6-
for file in sys.argv[1:]:
7-
if os.path.isdir(file):
8-
print file, "Directory!"
6+
for filename in sys.argv[1:]:
7+
if os.path.isdir(filename):
8+
print filename, "Directory!"
99
continue
10-
data = open(file, "rb").read()
10+
data = open(filename, "rb").read()
1111
if '\0' in data:
12-
print file, "Binary!"
12+
print filename, "Binary!"
1313
continue
1414
newdata = re.sub("\r?\n", "\r\n", data)
1515
if newdata != data:
16-
print file
17-
f = open(file, "wb")
16+
print filename
17+
f = open(filename, "wb")
1818
f.write(newdata)
1919
f.close()

0 commit comments

Comments
 (0)