summaryrefslogtreecommitdiffstats
path: root/Parser/pegen.c
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-06-14 16:46:11 (GMT)
committerGitHub <noreply@github.com>2021-06-14 16:46:11 (GMT)
commit507ed6fa1d6661e0f8e6d3282764aa9625a99594 (patch)
tree12f906c723fcd0c24383725fa1d5899cc8c8429f /Parser/pegen.c
parentcc8ecf6864375994899fd79d601ab05d0df9edbf (diff)
downloadcpython-507ed6fa1d6661e0f8e6d3282764aa9625a99594.zip
cpython-507ed6fa1d6661e0f8e6d3282764aa9625a99594.tar.gz
cpython-507ed6fa1d6661e0f8e6d3282764aa9625a99594.tar.bz2
bpo-44409: Fix error location in tokenizer errors that happen during initialization (GH-26712)
Diffstat (limited to 'Parser/pegen.c')
-rw-r--r--Parser/pegen.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Parser/pegen.c b/Parser/pegen.c
index 1941244..615047c 100644
--- a/Parser/pegen.c
+++ b/Parser/pegen.c
@@ -283,6 +283,7 @@ static void
raise_tokenizer_init_error(PyObject *filename)
{
if (!(PyErr_ExceptionMatches(PyExc_LookupError)
+ || PyErr_ExceptionMatches(PyExc_SyntaxError)
|| PyErr_ExceptionMatches(PyExc_ValueError)
|| PyErr_ExceptionMatches(PyExc_UnicodeDecodeError))) {
return;