MCPcopy Create free account
hub / github.com/pybind/pybind11 / restore

Function restore

include/pybind11/pytypes.h:772–772  ·  view source on GitHub ↗

Restores the currently-held Python error (which will clear the Python error indicator first if already set). NOTE: This member function will always restore the normalized exception, which may or may not be the original Python exception. WARNING: The GIL must be held when this member function is called!

Source from the content-addressed store, hash-verified

770 /// not be the original Python exception.
771 /// WARNING: The GIL must be held when this member function is called!
772 void restore() { m_fetched_error->restore(); }
773
774 /// If it is impossible to raise the currently-held error, such as in a destructor, we can
775 /// write it out using Python's unraisable hook (`sys.unraisablehook`). The error context

Callers 1

discard_as_unraisableFunction · 0.85

Calls 1

restoreMethod · 0.80

Tested by

no test coverage detected