[issue42418] PyType_GetModule() should warn/fail when type has Py_TPFLAGS_BASETYPE

hai shi report at bugs.python.org
Fri Nov 20 13:25:06 EST 2020


hai shi <shihai1991 at 126.com> added the comment:

>I propose to either a guard to PyType_GetModule() to prevent misuse of the function or to add a variant of the function that prevents misuse.
+1. Looks like check Py_TPFLAGS_BASETYPE in PyType_GetModule() is an easy way:)

----------
nosy: +shihai1991

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


More information about the Python-bugs-list mailing list