You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So we want to stop SystemExit from causing
an actual exit() when using python -i.
This patch introduces two new API calls,
PyRun_BlockSysExit and PyRun_UnblockSysExit,
to set a flag toavoid the exit() call in
PyErr_PrintEx.
There are several other ways to fix this
bug, but I think all of the others I came up
with would cause more backwards compatibilty
problems and/or be a lot more work.
Some possibilities, if anyone is interested,
would be:
Add a new PyCompilerFlags flag
This seems a bit ugly, as it's not really
a "compile flag".
Add some special run routines that
block the exit.
Add another parameter to existing
run routines.
Change PyErr_PrintEx so it doesn't
exit when printing a SystemError, instead
having the run routines responsible for
exiting when catching that exception.
What do you think? Is my patch good enough,
or would you like something else?
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: