mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Add internal routine _PyModule_Clear(), which does approximately what
clear_carefully() used to do in import.c. Differences: leave only __builtins__ alone in the 2nd pass; and don't clear the dictionary (on the theory that as long as there are references left to the dictionary, those might be destructors that might expect __builtins__ to be alive when they run; and __builtins__ can't normally be part of a cycle).
This commit is contained in:
parent
c83db33781
commit
f1dc0615e9
2 changed files with 51 additions and 1 deletions
|
@ -44,6 +44,7 @@ extern DL_IMPORT(PyTypeObject) PyModule_Type;
|
|||
extern PyObject *PyModule_New Py_PROTO((char *));
|
||||
extern PyObject *PyModule_GetDict Py_PROTO((PyObject *));
|
||||
extern char *PyModule_GetName Py_PROTO((PyObject *));
|
||||
extern void _PyModule_Clear Py_PROTO((PyObject *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue