Test atexit shutdown mechanism in a subprocess by pitrou · Pull Request #4828 · python/cpython
| /* For the atexit module. */ | ||
| void _Py_PyAtExit(void (*func)(void)) | ||
| { | ||
| /* Guard against API misuse */ |
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.
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.
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:
python: Python/pylifecycle.c:2090: void _Py_PyAtExit(void (*)(void)): Assertion `_PyRuntime.pyexitfunc == ((void*)0) || _PyRuntime.pyexitfunc == func' failed.
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.
🐍🍒⛏🤖
pitrou
deleted the
atexit_check_subprocess
branch
Sorry, @pitrou, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker fc5db95e0063eafa2bfb7f487fcaad5a7c4b65a1 3.6
pitrou added a commit to pitrou/cpython that referenced this pull request
* Test atexit shutdown mechanism in a subprocess. (cherry picked from commit fc5db95)
pitrou added a commit that referenced this pull request
* Test atexit shutdown mechanism in a subprocess. (cherry picked from commit fc5db95)