mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Cleanup exit code for interpreter. (GH-17756)
This commit is contained in:
parent
97f1267a54
commit
e7c9f4aae1
2 changed files with 5 additions and 42 deletions
|
@ -1913,7 +1913,8 @@ main_loop:
|
|||
case TARGET(RETURN_VALUE): {
|
||||
retval = POP();
|
||||
assert(f->f_iblock == 0);
|
||||
goto exit_returning;
|
||||
assert(EMPTY());
|
||||
goto exiting;
|
||||
}
|
||||
|
||||
case TARGET(GET_AITER): {
|
||||
|
@ -2083,7 +2084,7 @@ main_loop:
|
|||
/* and repeat... */
|
||||
assert(f->f_lasti >= (int)sizeof(_Py_CODEUNIT));
|
||||
f->f_lasti -= sizeof(_Py_CODEUNIT);
|
||||
goto exit_yielding;
|
||||
goto exiting;
|
||||
}
|
||||
|
||||
case TARGET(YIELD_VALUE): {
|
||||
|
@ -2100,7 +2101,7 @@ main_loop:
|
|||
}
|
||||
|
||||
f->f_stacktop = stack_pointer;
|
||||
goto exit_yielding;
|
||||
goto exiting;
|
||||
}
|
||||
|
||||
case TARGET(POP_EXCEPT): {
|
||||
|
@ -3632,15 +3633,13 @@ exception_unwind:
|
|||
assert(retval == NULL);
|
||||
assert(_PyErr_Occurred(tstate));
|
||||
|
||||
exit_returning:
|
||||
|
||||
/* Pop remaining stack entries. */
|
||||
while (!EMPTY()) {
|
||||
PyObject *o = POP();
|
||||
Py_XDECREF(o);
|
||||
}
|
||||
|
||||
exit_yielding:
|
||||
exiting:
|
||||
if (tstate->use_tracing) {
|
||||
if (tstate->c_tracefunc) {
|
||||
if (call_trace_protected(tstate->c_tracefunc, tstate->c_traceobj,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue