Antoine Pitrou added the comment:

Theoretically, people *should* already incref the result from 
PyState_FindModule. On the other hand, the object currently wouldn't be lost 
unless something else calls PyState_RemoveModule(), which is hardly every used 
AFAICT.

The only saving grace is that PyState_FindModule() is py3-specific, and only 
used for extension modules which have a positive m_size (probably not many of 
them yet).

(I think this issue teaches us that borrowed ref-returning APIs are a bad idea)

Unfortunately, without this change, we also make it difficult or impossible to 
reclaim extension modules using the GC. At least I cannot think of another way.

----------

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

Reply via email to