summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMarcel Plch <gmarcel.plch@gmail.com>2017-12-20 10:17:58 (GMT)
committerAntoine Pitrou <pitrou@free.fr>2017-12-20 10:17:58 (GMT)
commit776407fe893fd42972c7e3f71423d9d86741d07c (patch)
tree2d2a5781d83709c56d27e5815af2d7a2fc5726c0 /Include
parent19760863623b636a63ccf649107d9504c6465a92 (diff)
downloadcpython-776407fe893fd42972c7e3f71423d9d86741d07c.zip
cpython-776407fe893fd42972c7e3f71423d9d86741d07c.tar.gz
cpython-776407fe893fd42972c7e3f71423d9d86741d07c.tar.bz2
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 305526d..0b464bc 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 77c4330..afeae93 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 ed5b6c9..3282eb9 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 */