Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-125880: Fix exit codes in PyREPL#125890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
@@ -101,6 +101,7 @@ pymain_err_print(int *exitcode_p) | |||
int exitcode; | |||
if (_Py_HandleSystemExit(&exitcode)) { | |||
*exitcode_p = exitcode; | |||
Py_Exit(exitcode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is needed in order to match behavior ofPyRUn_AnyFileExFlags
(which the old REPL called an still calls ifPYTHON_BASIC_REPL=1
) which somewhere callshandle_system_exit
(Python/pythonrun.c::L632)
) which handlesSystemExit
and callsPy_Exit
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
In that case this path doesn't return as this callsPyFinalize_Ex
and thenexit()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
As well as previous approach withPyRun_AnyFileExFlags
, so, is this a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Not sure I follow what you mean. Could you clarify ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Sorry for not being clear!
I mean, the previous approach withPyRun_AnyFileExFlags
contains path withhandle_system_exit
which is also didn't return as it callsPyFinalizeEx
and thenexit()
.
Uh oh!
There was an error while loading.Please reload this page.