Anand Balachandran Pillai wrote:
> Hi Amaury,
>
> This is the entry for _warnings.
>
> /* This lives in _warnings.c */
> {"_warnings", _PyWarnings_Init},
Did you find this in Modules/config.c?
> Btw, you said _warnings is not designed to be a .so module. So what type of
> module is _warnings ?
It's a built-in module.
A module is said "built-in" if its initialization function is linked
inside the main program.
When you "import _warnings", python looks inside the list defined in
config.c, and runs the _PyWarnings_Init function it found there.
An extension module resides in a .so, which name is also the name of the module.
Its initialization function must be of the form "init%s"
It's not the case for _warnings. You would have to rename
_PyWarnings_Init to init_warnings...
--
Amaury Forgeot d'Arc
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com