-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test atexit shutdown mechanism in a subprocess #4828
Conversation
…t_check_subprocess
Python/pylifecycle.c
Outdated
@@ -2086,6 +2086,8 @@ _Py_FatalInitError(_PyInitError err) | |||
/* For the atexit module. */ | |||
void _Py_PyAtExit(void (*func)(void)) | |||
{ | |||
/* Guard against API misuse */ |
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.
Maybe add "bpo-17852: " prefix. Otherwise, the purpose of the assertion is not obvious.
Or explain that calling this function to register a new callback replaces the previous callback, which is unlikely to be the expected behaviour.
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.
Yes, adding a bpo references sounds good to me.
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.
test_atexit test LGTM, I just have a question/comment on the added assertion.
I merged your PR #4826, so you can rebase this one on top of it.
At least, the assertion worked as expected before you rebased this PR on top of PR #4826, Travis CI failed with:
|
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.
LGTM, thanks.
Thanks @pitrou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6. |
Sorry, @pitrou, I could not cleanly backport this to |
* Test atexit shutdown mechanism in a subprocess. (cherry picked from commit fc5db95)
GH-4829 is a backport of this pull request to the 3.6 branch. |
Needs #4826 to work.