Using PyImport_ExtendInittab with package

J

Julien Danjou

Hi,

I'm trying to embed Python and therefore use PyImport_ExtendInittab() to
register modules.
My current problem is that, if it works well with a simple module
"hello", naming a module "hello.foobar" in the inittab struct does not
seems to work.
imp.find_module("hello.foobar") returns correctly that the module is
found, but import hello.foobar fails badly.

Is . notation supported in inittab? Am I doing something wrong?

--
Julien Danjou
// á° <[email protected]> http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974 C95C A462 B51E C2FE E5CD
// Don't give up.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAksrx1kACgkQpGK1HsL+5c3DhwCfYwg/IlwJIjVW8BOgXnS8MRCD
EjoAnAlJPjrMrDjjJwPYEGLm+hTe0yEo
=FA4D
-----END PGP SIGNATURE-----
 
A

Aahz

I'm trying to embed Python and therefore use PyImport_ExtendInittab() to
register modules.
My current problem is that, if it works well with a simple module
"hello", naming a module "hello.foobar" in the inittab struct does not
seems to work.
imp.find_module("hello.foobar") returns correctly that the module is
found, but import hello.foobar fails badly.

Is . notation supported in inittab? Am I doing something wrong?

This is probably wrong in some detail, but I think you need to import
each level of a package separately. I.e. you need to import 'hello'
before you can import 'hello.foobar'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,199
Latest member
AnyaFlynn6

Latest Threads

Top