summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-01-31 22:48:23 (GMT)
committerGitHub <noreply@github.com>2021-01-31 22:48:23 (GMT)
commit40901518167c66abc1ebc5b71c5b86d733cfa154 (patch)
tree138c2482c5b1e1c91bb705d4dac941260aeb35d4 /Parser
parenta1e9a1e120a11c563e166c15721169184c802f8b (diff)
downloadcpython-40901518167c66abc1ebc5b71c5b86d733cfa154.zip
cpython-40901518167c66abc1ebc5b71c5b86d733cfa154.tar.gz
cpython-40901518167c66abc1ebc5b71c5b86d733cfa154.tar.bz2
bpo-42986: Fix parser crash when reporting syntax errors in f-string with newlines (GH-24279)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/pegen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/pegen.c b/Parser/pegen.c
index 0e7f86b..2554273 100644
--- a/Parser/pegen.c
+++ b/Parser/pegen.c
@@ -454,7 +454,7 @@ _PyPegen_raise_error_known_location(Parser *p, PyObject *errtype,
does not physically exist */
assert(p->tok->fp == NULL || p->tok->fp == stdin || p->tok->done == E_EOF);
- if (p->tok->lineno == lineno) {
+ if (p->tok->lineno <= lineno) {
Py_ssize_t size = p->tok->inp - p->tok->buf;
error_line = PyUnicode_DecodeUTF8(p->tok->buf, size, "replace");
}