Fix an issue that created an endless loop.

This commit is contained in:
Dave Halter
2017-08-26 03:08:10 +02:00
parent ede8a2139f
commit 8a448303d1
2 changed files with 3 additions and 3 deletions

View File

@@ -144,11 +144,11 @@ def _tokenize(code, start_pos=(1, 0)):
search *= 3 search *= 3
start += 2 start += 2
index = code.find(search) index = code.find(search, start)
if index == -1: if index == -1:
index = len(code) index = len(code)
expression += code[start:index] expression += code[start:index]
start = index start = index + 1
elif found == '!' and len(code) > start and code[start] == '=': elif found == '!' and len(code) > start and code[start] == '=':
# This is a python `!=` and not a conversion. # This is a python `!=` and not a conversion.
expression += found expression += found

View File

@@ -142,7 +142,7 @@ FAILING_EXAMPLES = [
# f-strings # f-strings
'f"{}"', 'f"{}"',
'f"{\\}"', 'f"{\\}"',
#'f"{\'\\\'}"', 'f"{\'\\\'}"',
'f"{#}"', 'f"{#}"',
] ]