[Python-Dev] embedding - PyImport_AppendInittab() after Py_Initialize() (original) (raw)
Vitaly Murashev vitaly.murashev at gmail.com
Fri May 27 05:49:08 EDT 2016
- Previous message (by thread): [Python-Dev] Python parser performance optimizations
- Next message (by thread): [Python-Dev] embedding - PyImport_AppendInittab() after Py_Initialize()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Could anyone please clarify whether it is correct in python3.5 to call PyImport_AppendInittab() after Py_Initialize()
I found this case among the tests for boost.python https://github.com/boostorg/python/blob/develop/test/exec.cpp
And this test doesn't work for me with python3.5.An error looks like:
exec.cpp(137): Python Error detected in function 'void __cdecl check_pyerr(bool)' Traceback (most recent call last): File "", line 1, in ImportError: 'embedded_hello' is not a built-in module 1 error detected.
After debugging I found out that root cause is in importlib/_bootstrap.py which do the following:
if fullname not in sys.builtin_module_names:
raise ImportError('{!r} is not a built-in
module'.format(fullname), name=fullname)
but sys.builtin_module_names is the constant which initialized once in Py_Initialize()
To summarize: Is it a bug in python3.5 or original test inside boost.python should be fixed ? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20160527/552c4b8b/attachment.html>
- Previous message (by thread): [Python-Dev] Python parser performance optimizations
- Next message (by thread): [Python-Dev] embedding - PyImport_AppendInittab() after Py_Initialize()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]