diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2022-09-27 23:23:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-27 23:23:42 +0100 |
commit | aab01e3524d966dca6e72c718a2c71403a14e47c (patch) | |
tree | 69e30e5354e49bc104177ab61ee8b39ccd24bf22 /Python/pythonrun.c | |
parent | dd53b79de0ea98af6a11481217a961daef4e9774 (diff) | |
download | cpython-git-aab01e3524d966dca6e72c718a2c71403a14e47c.tar.gz |
gh-96670: Raise SyntaxError when parsing NULL bytes (#97594)
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 202df585f3..acb1330b85 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1858,7 +1858,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; |