mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
GH-106895: Raise a ValueError
when attempting to disable events that cannot be disabled. (GH-107337)
This commit is contained in:
parent
d77d973335
commit
c6539b36c1
9 changed files with 120 additions and 52 deletions
7
Python/executor_cases.c.h
generated
7
Python/executor_cases.c.h
generated
|
@ -1949,7 +1949,12 @@
|
|||
assert(val && PyExceptionInstance_Check(val));
|
||||
exc = PyExceptionInstance_Class(val);
|
||||
tb = PyException_GetTraceback(val);
|
||||
Py_XDECREF(tb);
|
||||
if (tb == NULL) {
|
||||
tb = Py_None;
|
||||
}
|
||||
else {
|
||||
Py_DECREF(tb);
|
||||
}
|
||||
assert(PyLong_Check(lasti));
|
||||
(void)lasti; // Shut up compiler warning if asserts are off
|
||||
PyObject *stack[4] = {NULL, exc, val, tb};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue