Visitar URL original
gh-102251: Updates to test_imp Toward Fixing Some Refleaks by ericsnowcurrently · Pull Request #102254 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
_modules_by_index_clear() -> _modules_by_index_clear_one().
  • Loading branch information
ericsnowcurrently committed Feb 17, 2023
commit 9bbeddadba9071737cf3b3fec988e0e25c58911a
6 changes: 3 additions & 3 deletions Python/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ _modules_by_index_set(PyInterpreterState *interp,
}

static int
_modules_by_index_clear(PyInterpreterState *interp, PyModuleDef *def)
_modules_by_index_clear_one(PyInterpreterState *interp, PyModuleDef *def)
{
Py_ssize_t index = def->m_base.m_index;
const char *err = _modules_by_index_check(interp, index);
Expand Down Expand Up @@ -546,7 +546,7 @@ PyState_RemoveModule(PyModuleDef* def)
"PyState_RemoveModule called on module with slots");
return -1;
}
return _modules_by_index_clear(tstate->interp, def);
return _modules_by_index_clear_one(tstate->interp, def);
}


Expand Down Expand Up @@ -1007,7 +1007,7 @@ clear_singlephase_extension(PyInterpreterState *interp,

/* Clear the PyState_*Module() cache entry. */
if (_modules_by_index_check(interp, def->m_base.m_index) == NULL) {
if (_modules_by_index_clear(interp, def) < 0) {
if (_modules_by_index_clear_one(interp, def) < 0) {
return -1;
}
}
Expand Down