mirror of
https://github.com/python/cpython.git
synced 2025-07-10 04:45:36 +00:00
keep exitfunc alive while calling it
This commit is contained in:
parent
f7f79ac0c8
commit
1c45ca310b
1 changed files with 2 additions and 0 deletions
|
@ -605,12 +605,14 @@ cleanup()
|
|||
|
||||
if (exitfunc) {
|
||||
object *res;
|
||||
INCREF(exitfunc);
|
||||
sysset("exitfunc", (object *)NULL);
|
||||
res = call_object(exitfunc, (object *)NULL);
|
||||
if (res == NULL) {
|
||||
fprintf(stderr, "Error in sys.exitfunc:\n");
|
||||
print_error();
|
||||
}
|
||||
DECREF(exitfunc);
|
||||
}
|
||||
|
||||
flushline();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue