summaryrefslogtreecommitdiff
path: root/Include
diff options
context:
space:
mode:
authorMarcel Plch <gmarcel.plch@gmail.com>2017-12-20 11:17:58 +0100
committerAntoine Pitrou <pitrou@free.fr>2017-12-20 11:17:58 +0100
commit776407fe893fd42972c7e3f71423d9d86741d07c (patch)
tree2d2a5781d83709c56d27e5815af2d7a2fc5726c0 /Include
parent19760863623b636a63ccf649107d9504c6465a92 (diff)
downloadcpython-git-776407fe893fd42972c7e3f71423d9d86741d07c.tar.gz
bpo-31901: atexit callbacks should be run at subinterpreter shutdown (#4611)
Change atexit behavior and PEP-489 multiphase init support.
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pystate.h1
-rw-r--r--Include/pylifecycle.h2
-rw-r--r--Include/pystate.h3
3 files changed, 4 insertions, 2 deletions
diff --git a/Include/internal/pystate.h b/Include/internal/pystate.h
index 305526d136..0b464bcb2e 100644
--- a/Include/internal/pystate.h
+++ b/Include/internal/pystate.h
@@ -90,7 +90,6 @@ typedef struct pyruntimestate {
#define NEXITFUNCS 32
void (*exitfuncs[NEXITFUNCS])(void);
int nexitfuncs;
- void (*pyexitfunc)(void);
struct _gc_runtime_state gc;
struct _warnings_runtime_state warnings;
diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h
index 77c4330ebc..afeae93f00 100644
--- a/Include/pylifecycle.h
+++ b/Include/pylifecycle.h
@@ -92,7 +92,7 @@ PyAPI_FUNC(void) Py_EndInterpreter(PyThreadState *);
* exit functions.
*/
#ifndef Py_LIMITED_API
-PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(void));
+PyAPI_FUNC(void) _Py_PyAtExit(void (*func)(PyObject *), PyObject *);
#endif
PyAPI_FUNC(int) Py_AtExit(void (*func)(void));
diff --git a/Include/pystate.h b/Include/pystate.h
index ed5b6c9bd1..3282eb9d4d 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -131,6 +131,9 @@ typedef struct _is {
PyObject *after_forkers_parent;
PyObject *after_forkers_child;
#endif
+ /* AtExit module */
+ void (*pyexitfunc)(PyObject *);
+ PyObject *pyexitmodule;
} PyInterpreterState;
#endif /* !Py_LIMITED_API */