diff options
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | 2023-05-07 10:12:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-07 10:12:04 (GMT) |
commit | a09d3901a5329fd58a29f730ae5f48fb38f66320 (patch) | |
tree | a8504553d8184a6281dc8099503559f494482d22 /Python/pythonrun.c | |
parent | c5dafeaa6d2dddd1d9e611424d8abf3a934880c6 (diff) | |
download | cpython-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.c | 2 |
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; |