summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-08-02 18:39:46 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-08-02 18:39:46 (GMT)
commit95db2e7b8a0477ddf60902ca0aacdafbb265e5a5 (patch)
tree082db54bac3ba572964b54da33bd757661e3ab20 /Python/pystate.c
parent865d12a2d9108b04f3417b0f772dfff5bf9840cb (diff)
downloadcpython-95db2e7b8a0477ddf60902ca0aacdafbb265e5a5.zip
cpython-95db2e7b8a0477ddf60902ca0aacdafbb265e5a5.tar.gz
cpython-95db2e7b8a0477ddf60902ca0aacdafbb265e5a5.tar.bz2
Backout 62658d9d8926 (issue #10241): it causes a crash at shutdown when deallocating a Tkapp object.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 924b6a2..40606bf 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -320,31 +320,6 @@ PyState_RemoveModule(struct PyModuleDef* def)
return PyList_SetItem(state->modules_by_index, index, Py_None);
}
-/* used by import.c:PyImport_Cleanup */
-void
-_PyState_ClearModules(void)
-{
- PyInterpreterState *state = PyThreadState_GET()->interp;
- if (state->modules_by_index) {
- Py_ssize_t i;
- for (i = 0; i < PyList_GET_SIZE(state->modules_by_index); i++) {
- PyObject *m = PyList_GET_ITEM(state->modules_by_index, i);
- if (PyModule_Check(m)) {
- /* cleanup the saved copy of module dicts */
- PyModuleDef *md = PyModule_GetDef(m);
- if (md)
- Py_CLEAR(md->m_base.m_copy);
- }
- }
- /* Setting modules_by_index to NULL could be dangerous, so we
- clear the list instead. */
- if (PyList_SetSlice(state->modules_by_index,
- 0, PyList_GET_SIZE(state->modules_by_index),
- NULL))
- PyErr_WriteUnraisable(state->modules_by_index);
- }
-}
-
void
PyThreadState_Clear(PyThreadState *tstate)
{