Skip to content

Conversation

@Eclips4
Copy link
Member

@Eclips4 Eclips4 commented Oct 23, 2024

@Eclips4 Eclips4 marked this pull request as ready for review October 26, 2024 22:01
int exitcode;
if (_Py_HandleSystemExit(&exitcode)) {
*exitcode_p = exitcode;
Py_Exit(exitcode);
Copy link
Member Author

@Eclips4 Eclips4 Oct 26, 2024

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 of PyRUn_AnyFileExFlags(which the old REPL called an still calls if PYTHON_BASIC_REPL=1) which somewhere calls handle_system_exit (Python/pythonrun.c::L632)) which handles SystemExit and calls Py_Exit.

Copy link
Member

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 calls PyFinalize_Ex and then exit()

Copy link
Member Author

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 with PyRun_AnyFileExFlags, so, is this a problem?

Copy link
Member

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 ?

Copy link
Member Author

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 with PyRun_AnyFileExFlags contains path with handle_system_exit which is also didn't return as it calls PyFinalizeEx and then exit().

@Eclips4 Eclips4 added the needs backport to 3.13 bugs and security fixes label Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants