Don't use max as a variable

This commit is contained in:
Dave Halter
2020-04-03 03:35:21 +02:00
parent 77327a4cea
commit 0c0aa31a91

View File

@@ -410,7 +410,7 @@ def tokenize_lines(lines, version_info, start_pos=(1, 0), indents=None):
paren_level = 0 # count parentheses paren_level = 0 # count parentheses
if indents is None: if indents is None:
indents = [0] indents = [0]
max = 0 max_ = 0
numchars = '0123456789' numchars = '0123456789'
contstr = '' contstr = ''
contline = None contline = None
@@ -427,17 +427,17 @@ def tokenize_lines(lines, version_info, start_pos=(1, 0), indents=None):
for line in lines: # loop over lines in stream for line in lines: # loop over lines in stream
lnum += 1 lnum += 1
pos = 0 pos = 0
max = len(line) max_ = len(line)
if first: if first:
if line.startswith(BOM_UTF8_STRING): if line.startswith(BOM_UTF8_STRING):
additional_prefix = BOM_UTF8_STRING additional_prefix = BOM_UTF8_STRING
line = line[1:] line = line[1:]
max = len(line) max_ = len(line)
# Fake that the part before was already parsed. # Fake that the part before was already parsed.
line = '^' * start_pos[1] + line line = '^' * start_pos[1] + line
pos = start_pos[1] pos = start_pos[1]
max += start_pos[1] max_ += start_pos[1]
first = False first = False
@@ -455,7 +455,7 @@ def tokenize_lines(lines, version_info, start_pos=(1, 0), indents=None):
contline = contline + line contline = contline + line
continue continue
while pos < max: while pos < max_:
if fstring_stack: if fstring_stack:
tos = fstring_stack[-1] tos = fstring_stack[-1]
if not tos.is_in_expr(): if not tos.is_in_expr():
@@ -470,7 +470,7 @@ def tokenize_lines(lines, version_info, start_pos=(1, 0), indents=None):
) )
tos.previous_lines = '' tos.previous_lines = ''
continue continue
if pos == max: if pos == max_:
break break
rest = line[pos:] rest = line[pos:]
@@ -666,7 +666,7 @@ def tokenize_lines(lines, version_info, start_pos=(1, 0), indents=None):
prefix='' prefix=''
) )
end_pos = lnum, max end_pos = lnum, max_
# As the last position we just take the maximally possible position. We # As the last position we just take the maximally possible position. We
# remove -1 for the last new line. # remove -1 for the last new line.
for indent in indents[1:]: for indent in indents[1:]: