| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bcdd307 commit 017f047
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -150,6 +150,7 @@ def _ready_to_import(name=None, source=""): | |||
| 150 | 150 | def restore__testsinglephase(*, _orig=_testsinglephase): | |
| 151 | 151 | # We started with the module imported and want to restore | |
| 152 | 152 | # it to its nominal state. | |
| 153 | + sys.modules.pop('_testsinglephase', None) | ||
| 153 | 154 | _orig._clear_globals() | |
| 154 | 155 | _testinternalcapi.clear_extension('_testsinglephase', _orig.__file__) | |
| 155 | 156 | import _testsinglephase | |
@@ -2125,7 +2126,7 @@ def clean_up(): | |||
| 2125 | 2126 | _interpreters.run_string(interpid, textwrap.dedent(f''' | |
| 2126 | 2127 | name = {self.NAME!r} | |
| 2127 | 2128 | if name in sys.modules: | |
| 2128 | - sys.modules[name]._clear_globals() | ||
| 2129 | + sys.modules.pop(name)._clear_globals() | ||
| 2129 | 2130 | _testinternalcapi.clear_extension(name, {self.FILE!r}) | |
| 2130 | 2131 | ''')) | |
| 2131 | 2132 | _interpreters.destroy(interpid) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1073,6 +1073,7 @@ _extensions_cache_delete(PyObject *filename, PyObject *name) | |||
| 1073 | 1073 | However, this decref would be problematic if the module def were | |
| 1074 | 1074 | dynamically allocated, it were the last ref, and this function | |
| 1075 | 1075 | were called with an interpreter other than the def's owner. */ | |
| 1076 | + assert(_Py_IsImmortal(entry->value)); | ||
| 1076 | 1077 | entry->value = NULL; | |
| 1077 | 1078 | ||
| 1078 | 1079 | finally: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments