File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Misc/NEWS.d/next/Documentation Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -127,13 +127,11 @@ Intermezzo: Errors and Exceptions
127127
128128An important convention throughout the Python interpreter is the following: when
129129a function fails, it should set an exception condition and return an error value
130- (usually a ``NULL `` pointer). Exceptions are stored in a static global variable
131- inside the interpreter; if this variable is ``NULL `` no exception has occurred. A
132- second global variable stores the "associated value" of the exception (the
133- second argument to :keyword: `raise `). A third variable contains the stack
134- traceback in case the error originated in Python code. These three variables
135- are the C equivalents of the result in Python of :meth: `sys.exc_info ` (see the
136- section on module :mod: `sys ` in the Python Library Reference). It is important
130+ (usually ``-1 `` or a ``NULL `` pointer). Exception information is stored in
131+ three members of the interpreter's thread state. These are ``NULL `` if
132+ there is no exception. Otherwise they are the C equivalents of the members
133+ of the Python tuple returned by :meth: `sys.exc_info `. These are the
134+ exception type, exception instance, and a traceback object. It is important
137135to know about them to understand how errors are passed around.
138136
139137The Python API defines a number of functions to set various types of exceptions.
Original file line number Diff line number Diff line change 1+ In the extending chapter of the extending doc, update a paragraph about the
2+ global variables containing exception information.
You can’t perform that action at this time.
0 commit comments