Antoine Pitrou added the comment:

Ok, I can now reproduce with setswitchinterval(). Here is a patch. There was a 
race between putting the new module in sys.modules and setting its 
__initializing__ attribute, so now __initializing__ is set before putting the 
module in sys.modules.

Also, there was another race when retrieving a module lock from the locks dict 
(the weakref could be destroyed between the __contains__ test and the actual 
fetch).

----------
keywords: +patch
nosy: +georg.brandl
priority: normal -> release blocker
stage:  -> patch review
Added file: http://bugs.python.org/file27019/importrace.patch

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

Reply via email to