[issue4612] PyModule_Create() doesn't add/import module

2008-12-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: OK. I'm currently writing a documentation patch for issue4592. ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue4612] PyModule_Create() doesn't add/import module

2008-12-09 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: On Tue, Dec 9, 2008 at 14:34, Amaury Forgeot d'Arc <[EMAIL PROTECTED]> wrote: > > Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: > > When python is embedded in a program, there must be a way for the > program to export > some of its

[issue4612] PyModule_Create() doesn't add/import module

2008-12-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: When python is embedded in a program, there must be a way for the program to export some of its functions to python - a module that resides in the main executable. You cannot use the import machinery to import such a module, because

[issue4612] PyModule_Create() doesn't add/import module

2008-12-09 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: Ah, I had not looked at the issue; sorry about the confusion. PyImport_Create() is doing what it is supposed to be doing and should not call PyImport_AddModule(). The example is wrong. Closing this as invalid since the example is off.

[issue4612] PyModule_Create() doesn't add/import module

2008-12-09 Thread blake madden
blake madden <[EMAIL PROTECTED]> added the comment: Sorry, mate, that's all Greek to me--I'm a total noob with Python. I'm simply trying to run the example in r67655 (the "Extending Embedded Python" example) and it fails with "'emb' not being found". It appears that calling "PyModule_Create(&Em

[issue4612] PyModule_Create() doesn't add/import module

2008-12-09 Thread Brett Cannon
Changes by Brett Cannon <[EMAIL PROTECTED]>: -- status: open -> pending ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list

[issue4612] PyModule_Create() doesn't add/import module

2008-12-09 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: Are you returning the module in your extension's init function? The import machinery takes the returned module from the init function and adds it to sys.modules for you. -- nosy: +brett.cannon ___ Py

[issue4612] PyModule_Create() doesn't add/import module

2008-12-09 Thread blake madden
New submission from blake madden <[EMAIL PROTECTED]>: In reference to Issue4592 (which includes a patch), PyModule_Create()calls PyModule_New instead of PyImport_AddModule. Because of this, calling PyModule_Create() won't work like Py_InitModule(). Is this correct, because the documentation is