-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
bpo-45711: Remove type and traceback from exc_info #30122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
10687bd
37c7f12
c5c23bd
28ce9d2
8ee6d84
3306286
9b04160
4cd5af8
a72556e
787393b
458ad26
b2db87b
01f9036
ba82085
80b1e90
550f6f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,16 +24,10 @@ static inline PyObject* _PyErr_Occurred(PyThreadState *tstate) | |
|
||
static inline void _PyErr_ClearExcState(_PyErr_StackItem *exc_state) | ||
{ | ||
PyObject *t, *v, *tb; | ||
t = exc_state->exc_type; | ||
PyObject *v; | ||
v = exc_state->exc_value; | ||
tb = exc_state->exc_traceback; | ||
exc_state->exc_type = NULL; | ||
exc_state->exc_value = NULL; | ||
exc_state->exc_traceback = NULL; | ||
Py_XDECREF(t); | ||
Py_XDECREF(v); | ||
Py_XDECREF(tb); | ||
} | ||
|
||
PyAPI_FUNC(PyObject*) _PyErr_StackItemToExcInfoTuple( | ||
|
@@ -114,6 +108,10 @@ PyAPI_FUNC(void) _Py_NO_RETURN _Py_FatalRefcountErrorFunc( | |
|
||
#define _Py_FatalRefcountError(message) _Py_FatalRefcountErrorFunc(__func__, message) | ||
|
||
|
||
/* number of items stored in the stack for each exception */ | ||
#define PY_EXC_INFO_STACK_SIZE 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this necessary now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The name is probably weird now, but I think it helps readability to have a macro. If we remove this we should find another way to make the code (particularly in compile.c) clear about where exceptions are showing up. Figuring out where to use this macro was the hardest part of making this change (because when you get it wrong it just segfaults before you finish make regen-all). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On second thought there is no point in a macro for this unless we all agree on some kind of convention because it probably won't be updated correctly when people make changes. So I'll remove it. |
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
Uh oh!
There was an error while loading. Please reload this page.