diff options
author | Antoine Pitrou <pitrou@free.fr> | 2017-12-13 02:29:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-13 02:29:07 +0100 |
commit | fc5db95e0063eafa2bfb7f487fcaad5a7c4b65a1 (patch) | |
tree | 61bc58e4e52f4114140dee0e21f77b91364afa31 /Python/pylifecycle.c | |
parent | 317def9fdb29893df1ab380d396fcdd2eafe0588 (diff) | |
download | cpython-git-fc5db95e0063eafa2bfb7f487fcaad5a7c4b65a1.tar.gz |
Test atexit shutdown mechanism in a subprocess (#4828)
* Test atexit shutdown mechanism in a subprocess
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index fdb09d910d..f284855f34 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -2086,6 +2086,8 @@ _Py_FatalInitError(_PyInitError err) /* For the atexit module. */ void _Py_PyAtExit(void (*func)(void)) { + /* Guard against API misuse (see bpo-17852) */ + assert(_PyRuntime.pyexitfunc == NULL || _PyRuntime.pyexitfunc == func); _PyRuntime.pyexitfunc = func; } |