From olivier.voyer at gmail.com Thu Jul 24 16:10:10 2014 From: olivier.voyer at gmail.com (Olivier Voyer) Date: Thu, 24 Jul 2014 10:10:10 -0400 Subject: [capi-sig] PyImport_AppendInittab doesn't work with package and sub-module (Python 3.4) Message-ID: 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"); Any idea? -- *Olivier*