summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2023-05-07 12:12:04 +0200
committerGitHub <noreply@github.com>2023-05-07 11:12:04 +0100
commita09d3901a5329fd58a29f730ae5f48fb38f66320 (patch)
treea8504553d8184a6281dc8099503559f494482d22 /Python
parentc5dafeaa6d2dddd1d9e611424d8abf3a934880c6 (diff)
downloadpython-a09d3901a5329fd58a29f730ae5f48fb38f66320.tar.gz
python-a09d3901a5329fd58a29f730ae5f48fb38f66320.zip
[3.11] gh-96670: Raise SyntaxError when parsing NULL bytes (GH-97594) (#104195)
Diffstat (limited to 'Python')
-rw-r--r--Python/pythonrun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index f12b9f6e953..efa22b07256 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;