summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-08-18 16:13:10 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-08-18 16:13:10 (GMT)
commiteec9331b207cf7def6f04156d00a8479d1630dd3 (patch)
treece654c4b01d19f6b2bb1a3a05f961c07534e64c8 /Python
parent54005afeeebddbd5b211307b743b591a4cdb7750 (diff)
downloadcpython-eec9331b207cf7def6f04156d00a8479d1630dd3.zip
cpython-eec9331b207cf7def6f04156d00a8479d1630dd3.tar.gz
cpython-eec9331b207cf7def6f04156d00a8479d1630dd3.tar.bz2
Fix SystemError in "raise" statement
Issue #27558: Fix a SystemError in the implementation of "raise" statement. In a brand new thread, raise a RuntimeError since there is no active exception to reraise. Patch written by Xiang Zhang.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index c632488..8e396fd 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4123,7 +4123,7 @@ do_raise(PyObject *exc, PyObject *cause)
type = tstate->exc_type;
value = tstate->exc_value;
tb = tstate->exc_traceback;
- if (type == Py_None) {
+ if (type == Py_None || type == NULL) {
PyErr_SetString(PyExc_RuntimeError,
"No active exception to reraise");
return 0;