mirror of https://github.com/python/cpython
keep exitfunc alive while calling it
This commit is contained in:
parent
f7f79ac0c8
commit
1c45ca310b
|
@ -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…
Reference in New Issue