summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2023-05-07 10:12:04 (GMT)
committerGitHub <noreply@github.com>2023-05-07 10:12:04 (GMT)
commita09d3901a5329fd58a29f730ae5f48fb38f66320 (patch)
treea8504553d8184a6281dc8099503559f494482d22 /Python/pythonrun.c
parentc5dafeaa6d2dddd1d9e611424d8abf3a934880c6 (diff)
downloadcpython-a09d3901a5329fd58a29f730ae5f48fb38f66320.zip
cpython-a09d3901a5329fd58a29f730ae5f48fb38f66320.tar.gz
cpython-a09d3901a5329fd58a29f730ae5f48fb38f66320.tar.bz2
[3.11] gh-96670: Raise SyntaxError when parsing NULL bytes (GH-97594) (#104195)
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index f12b9f6..efa22b0 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1859,7 +1859,7 @@ _Py_SourceAsString(PyObject *cmd, const char *funcname, const char *what, PyComp
}
if (strlen(str) != (size_t)size) {
- PyErr_SetString(PyExc_ValueError,
+ PyErr_SetString(PyExc_SyntaxError,
"source code string cannot contain null bytes");
Py_CLEAR(*cmd_copy);
return NULL;