Il giorno 30/mar/2012, alle ore 06:26, C Anthony Risinger ha scritto: > On Thu, Mar 29, 2012 at 4:40 PM, C Anthony Risinger <[email protected]> wrote: >> >> ok, i stepped the code ... the problem is that the modules is compiled >> and imported: >> >> py_file_module = PyImport_ExecCodeModule(name, py_compiled_node); >> >> ... right BEFORE the __path__ is set. i was going to try and swap the >> two calls around, but the latter depends on the successful import, and >> im unsure how to add __path__ prior to executing the code object. > > ... but luckily, i like to RTFM! > > per the python C-API docs: > > PyModule_AddObject > ... creates an empty module if missing > > PyImport_ExecCodeModule > ... equivalent of a reload() if module already exists > > reload() > "When a module is reloaded, its dictionary (containing the module’s > global variables) is retained." > > ... so, create the module, and add __path__ ahead of time, then > reload() the code object into the existing module; linked patch fixes > problem for me! > > http://lists.unbit.it/pipermail/uwsgi/2012-March/003986.html > > thanks, > >
Seems good, i have commit in unstable tree, i will make some other tests that i will backport to stable and lts Thanks -- Roberto De Ioris http://unbit.it JID: [email protected] _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
