Commit b5d83dee authored by Stefan Behnel's avatar Stefan Behnel

fix crash due to temporarily inconsistent exception state in parallel exception handling code

parent c7bcb8b4
...@@ -277,9 +277,11 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) ...@@ -277,9 +277,11 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
goto bad; goto bad;
} }
#endif #endif
// traceback may be NULL for freshly raised exceptions
Py_XINCREF(local_tb); Py_XINCREF(local_tb);
Py_INCREF(local_type); // exception state may be temporarily empty in parallel loops (race condition)
Py_INCREF(local_value); Py_XINCREF(local_type);
Py_XINCREF(local_value);
*type = local_type; *type = local_type;
*value = local_value; *value = local_value;
*tb = local_tb; *tb = local_tb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment