Greg Ewing wrote: > Martin v. Löwis wrote: > >> However, _sre relied on the module already being in >> sys.modules, as it runs Python code in the init function that already >> imports the module being initialized. > > This issue also potentially affects all Pyrex and Cython > generated modules, which must be free to execute arbitrary > Python code during initialisation, including imports.
As I understand this, the problem only relates to importing the module being initialised, which a module won't do for itself. But I can well imagine the case that a third module that gets imported during the init phase happens to import the initialising module, i.e. a transitive re-import. Martin, talking about correctness, I would also expect the import code to prevent an infinite import loop here (or whatever the problem for _sre was). Stefan _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com