Fetch and hold an error which was already set in Python. An instance of this is typically thrown to propagate python-side errors back through C++ which can either be caught manually or else falls back to the function dispatcher (which then raises the captured error back to python).
Definition at line 324 of file pytypes.h.
void error_already_set::discard_as_unraisable |
( |
object |
err_context | ) |
|
|
inline |
If it is impossible to raise the currently-held error, such as in destructor, we can write it out using Python's unraisable hook (sys.unraisablehook). The error context should be some object whose repr() helps identify the location of the error. Python already knows the type and value of the error, so there is no need to repeat that. For example, func could be helpful. After this call, the current object no longer stores the error variables, and neither does Python.
Definition at line 348 of file pytypes.h.