This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients brett.cannon, pitrou, scoder
Date 2012-11-03.21:50:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351979442.17.0.345314289264.issue16392@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2012-11-03 21:50:42pitrousetrecipients: + pitrou, brett.cannon, scoder
2012-11-03 21:50:42pitrousetmessageid: <1351979442.17.0.345314289264.issue16392@psf.upfronthosting.co.za>
2012-11-03 21:50:42pitroulinkissue16392 messages
2012-11-03 21:50:42pitroucreate