Rename "input" to avoid redefining built-in

We formerly used a variable named "input".  This is legal in Python,
but potentially confusing since there's a built-in named "input"
that this shadows in that scope.  Rename the variable, to
avoid that confusion.  This fixes the following pylint warning:
W:1440, 8: Redefining built-in 'input' (redefined-builtin)

Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
This commit is contained in:
David A. Wheeler 2017-08-26 11:00:04 -04:00
parent ad0d06cced
commit 62c1db1141
1 changed files with 3 additions and 3 deletions

View File

@ -1437,7 +1437,7 @@ def process_c_file(f, patch_infos):
return
if f == "-":
input = sys.stdin
my_input = sys.stdin
else:
# Symlinks should never get here, but just in case...
if (not allowlink) and os.path.islink(f):
@ -1445,7 +1445,7 @@ def process_c_file(f, patch_infos):
num_links_skipped = num_links_skipped + 1
return
try:
input = open(f, "r")
my_input = open(f, "r")
except BaseException:
print("Error: failed to open", h(f))
sys.exit(1)
@ -1465,7 +1465,7 @@ def process_c_file(f, patch_infos):
print("Examining", f)
sys.stdout.flush()
text = "".join(input.readlines())
text = "".join(my_input.readlines())
i = 0
while i < len(text):