mirror of
https://github.com/python/cpython.git
synced 2025-09-13 12:17:24 +00:00
gh-105927: finalize_modules_clear_weaklist() uses _PyWeakref_GET_REF() (#105971)
finalize_modules_clear_weaklist() now holds a strong reference to the module longer than before: replace PyWeakref_GET_OBJECT() with _PyWeakref_GET_REF().
This commit is contained in:
parent
fc32522b08
commit
4328dc6465
3 changed files with 7 additions and 6 deletions
|
@ -33,7 +33,7 @@ static inline PyObject* _PyModule_GetDict(PyObject *mod) {
|
|||
PyObject *dict = ((PyModuleObject *)mod) -> md_dict;
|
||||
// _PyModule_GetDict(mod) must not be used after calling module_clear(mod)
|
||||
assert(dict != NULL);
|
||||
return dict;
|
||||
return dict; // borrowed reference
|
||||
}
|
||||
|
||||
PyObject* _Py_module_getattro_impl(PyModuleObject *m, PyObject *name, int suppress);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue