Python equivalent of PyErr_Print()
What is the Python API equivalent of PyErr_Print()
, from the C interface?
I'm assuming a call in either the sys
, or traceback
modules, but can't find any functions therein that make calls to PyErr_Print()
.
Addendum开发者_运维技巧
I'm after the Python call to get the same functionality as PyErr_PrintEx()
, described as:
Print a standard traceback to sys.stderr and clear the error indicator.
That is I want to make the Python call that has this effect.
There's no Python function that's exactly equivalent to PyErr_PrintEx
(the real name of PyErr_Print
;-), including for example setting sys.last_traceback
and friends (which are only supposed to be set to help a post-mortem debugging from the interactive interpreter for exceptions which have not been caught). What exact combination of functionality are you looking for?
精彩评论