STINNER Victor <vstin...@python.org> added the comment:

> So it isn't valid to skip calling the cleanup functions just because md_state 
> is NULL - we have no idea what Py_mod_create might have done that needs to be 
> cleaned up.

In your example, I don't see what m_clear/m_free would be supposed to 
clear/free.

I don't see how a module can store data without md_state which would require 
m_clear/m_free to clear/free such data. module_clear() continue to clear Python 
objects of the PyModuleObject structure with PR 18738.

Would you mind to elaborate?

The intent of PR 18738 is to simplify the implementation of C extension modules 
which implements the PEP 489 and uses a module state (md_state > 0).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39824>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to