[capi-sig] PyImport_AppendInittab doesn't work with package and sub-module (Python 3.4)

Olivier Voyer olivier.voyer at gmail.com
Thu Jul 24 16:10:10 CEST 2014

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

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:

PyInit__ABC);Py_Initialize();PyImport_ImportModule("import ABC");

But not this one:


Any idea?


More information about the capi-sig mailing list