Xiang Zhang added the comment: Thanks Petr. I'd appreciate it if you are willing to review the patch.
Upload a patch to fix this, along with tests and doc updating. But here is something different. In PEP489, it is explicitly stated that "Py_mod_create slot is not responsible for setting import-related attributes specified in PEP 451 (such as __name__ or __loader__ ) on the new module". So when an object(even ModuleType instances) is returned, it's __name__ attribute is not set and we can't rely on it (which means we can't even use PyModule_GetNameObject). I then use the name attribute of the spec. Looking forward to feedback. ---------- keywords: +patch Added file: http://bugs.python.org/file44136/issue27782.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27782> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com