[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free if md_state is NULL

STINNER Victor report at bugs.python.org
Mon Mar 2 04:53:06 EST 2020


STINNER Victor <vstinner at python.org> added the comment:

The question came up while I reviewed PR 18608 which ports the audioop extension module to multiphase initialization (PEP 489):
https://github.com/python/cpython/pull/18608/files#r386061746

Petr Viktorin referred to m_clear() documentation which says that md_state *can* be NULL when m_clear() is called:
https://docs.python.org/3/c-api/module.html#c.PyModuleDef.m_clear

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39824>
_______________________________________


More information about the Python-bugs-list mailing list