Antoine Pitrou added the comment:

Are you sure this worked before 3.3?

Regardless, it seems you could fix this issue by adding a single line just 
after the PyModule_Create() call:

  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (PyDict_SetItemString(PyImport_GetModuleDict(),
                           __Pyx_NAMESTR("reimport"), __pyx_m))
    goto __pyx_L1_error;


The fundamental issue is that an extension is inserted into sys.modules 
only after its initialization function returns, so importing it recursively 
won't detect that it already exists.

(by contrast, a Python module is inserted into sys.modules before its code is 
executed inside the module's global namespace)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16392>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to