cpython: 62658d9d8926 (original) (raw)

Mercurial > cpython

changeset 84958:62658d9d8926

Issue #10241: Clear extension module dict copies at interpreter shutdown. Patch by Neil Schemenauer, minimally modified. [#10241]

Antoine Pitrou solipsis@pitrou.net
date Thu, 01 Aug 2013 22:07:06 +0200
parents 36ff479e429c
children dae93ae6b713
files Include/pystate.h Misc/NEWS Python/import.c Python/pystate.c
diffstat 4 files changed, 33 insertions(+), 0 deletions(-)[+] [-] Include/pystate.h 3 Misc/NEWS 3 Python/import.c 2 Python/pystate.c 25

line wrap: on

line diff

--- a/Include/pystate.h +++ b/Include/pystate.h @@ -134,6 +134,9 @@ PyAPI_FUNC(int) PyState_AddModule(PyObje PyAPI_FUNC(int) PyState_RemoveModule(struct PyModuleDef*); #endif PyAPI_FUNC(PyObject*) PyState_FindModule(struct PyModuleDef*); +#ifndef Py_LIMITED_API +PyAPI_FUNC(void) _PyState_ClearModules(void); +#endif PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *); PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *);

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1? Core and Builtins ----------------- +- Issue #10241: Clear extension module dict copies at interpreter shutdown.

--- a/Python/import.c +++ b/Python/import.c @@ -380,6 +380,8 @@ PyImport_Cleanup(void) builtins = interp->builtins; interp->builtins = PyDict_New(); Py_DECREF(builtins);

--- a/Python/pystate.c +++ b/Python/pystate.c @@ -320,6 +320,31 @@ PyState_RemoveModule(struct PyModuleDef* return PyList_SetItem(state->modules_by_index, index, Py_None); } +/* used by import.c:PyImport_Cleanup */ +void +_PyState_ClearModules(void) +{

+} + void PyThreadState_Clear(PyThreadState *tstate) {