I have a C++ application that I swigged to Python 2.7. I'm currently trying to port my code from Python 2.7 to Python 3.4 using the Python/C API and SWIG.
I have a package containing multiple modules. The problem is I cannot find a way to initialize my module *ModuleABC* as a sub-module of package *PackageXYZ*. It works well with Python 2.7 but not with Python 3.4 (and I suppose it wouldn't work either with any Python 3.x version). This code works:
PyImport_AppendInittab("ABC", PyInit__ABC);Py_Initialize();PyImport_ImportModule("import ABC");
But not this one:
PyImport_AppendInittab("packageXYZ.ABC", PyInit__ABC);Py_Initialize();PyImport_ImportModule("import packageXYZ.ABC");