/* * C extensions module to test importing multiple modules from one compiled * file (issue16421). This file defines 3 modules (_testimportmodule, * foo, bar), only the first one is called the same as the compiled file. */ #include "pyconfig.h" // Py_GIL_DISABLED #ifndef Py_GIL_DISABLED #define Py_LIMITED_API … #endif #include <Python.h> static PyModuleDef_Slot shared_slots[] = …; static struct PyModuleDef _testimportmultiple = …; PyMODINIT_FUNC PyInit__testimportmultiple(void) { … } static struct PyModuleDef _foomodule = …; PyMODINIT_FUNC PyInit__testimportmultiple_foo(void) { … } static struct PyModuleDef _barmodule = …; PyMODINIT_FUNC PyInit__testimportmultiple_bar(void){ … }