mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
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.
This commit is contained in:
parent
54005afeee
commit
eec9331b20
3 changed files with 23 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue