From 8a448303d10d914600c22804dd4a8cde53ebef95 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 26 Aug 2017 03:08:10 +0200 Subject: [PATCH] Fix an issue that created an endless loop. --- parso/python/fstring.py | 4 ++-- test/failing_examples.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parso/python/fstring.py b/parso/python/fstring.py index 025a48c..50ee09c 100644 --- a/parso/python/fstring.py +++ b/parso/python/fstring.py @@ -144,11 +144,11 @@ def _tokenize(code, start_pos=(1, 0)): search *= 3 start += 2 - index = code.find(search) + index = code.find(search, start) if index == -1: index = len(code) expression += code[start:index] - start = index + start = index + 1 elif found == '!' and len(code) > start and code[start] == '=': # This is a python `!=` and not a conversion. expression += found diff --git a/test/failing_examples.py b/test/failing_examples.py index 7127ac3..89dc359 100644 --- a/test/failing_examples.py +++ b/test/failing_examples.py @@ -142,7 +142,7 @@ FAILING_EXAMPLES = [ # f-strings 'f"{}"', 'f"{\\}"', - #'f"{\'\\\'}"', + 'f"{\'\\\'}"', 'f"{#}"', ]