mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix IndexError when parsing unexpectedly ending quoted-string. (GH-14813)
This exception was caused because the input ended unexpectedly with only one single quote instead of a pair with some value inside it.
This commit is contained in:
parent
a4a994bd3e
commit
719a062bcb
3 changed files with 7 additions and 1 deletions
|
@ -1191,7 +1191,7 @@ def get_bare_quoted_string(value):
|
|||
"expected '\"' but found '{}'".format(value))
|
||||
bare_quoted_string = BareQuotedString()
|
||||
value = value[1:]
|
||||
if value[0] == '"':
|
||||
if value and value[0] == '"':
|
||||
token, value = get_qcontent(value)
|
||||
bare_quoted_string.append(token)
|
||||
while value and value[0] != '"':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue