Name
PyErr_Occurred
Synopsis
PyObject* PyErr_Occurred( )
Returns NULL
if no error is pending, otherwise a
borrowed reference to the type of the pending exception.
(Don’t use the returned value; call
PyErr_ExceptionMatches
instead, in order to catch
exceptions of subclasses as well, as is normal and expected.)
Get Python in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.