]> granicus.if.org Git - python/commitdiff
#5096: document PyErr_PrintEx().
authorGeorg Brandl <georg@python.org>
Thu, 5 Feb 2009 10:56:37 +0000 (10:56 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 5 Feb 2009 10:56:37 +0000 (10:56 +0000)
Doc/c-api/exceptions.rst

index 3fb6e567bf6694a3ab1c3f03cee15a583893d716..535513229b5f0ac3f85cb3367a11d03110b24438 100644 (file)
@@ -35,12 +35,21 @@ in various ways.  There is a separate error indicator for each thread.
    Either alphabetical or some kind of structure.
 
 
-.. cfunction:: void PyErr_Print()
+.. cfunction:: void PyErr_PrintEx(int set_sys_last_vars)
 
    Print a standard traceback to ``sys.stderr`` and clear the error indicator.
    Call this function only when the error indicator is set.  (Otherwise it will
    cause a fatal error!)
 
+   If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`,
+   :data:`sys.last_value` and :data:`sys.last_traceback` will be set to the
+   type, value and traceback of the printed exception, respectively.
+
+
+.. cfunction:: void PyErr_Print()
+
+   Alias for ``PyErr_PrintEx(1)``.
+
 
 .. cfunction:: PyObject* PyErr_Occurred()