Author pitrou
Recipients brett.cannon, pitrou, scoder
Date 2012-11-03.21:50:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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);
  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)
Date User Action Args
2012-11-03 21:50:42pitrousetrecipients: + pitrou, brett.cannon, scoder
2012-11-03 21:50:42pitrousetmessageid: <>
2012-11-03 21:50:42pitroulinkissue16392 messages
2012-11-03 21:50:42pitroucreate