2007/10/20, Nick Coghlan <[EMAIL PROTECTED]>: > bb.py is broken - importing a module should never spawn a new thread as > a side effect (precisely because it will deadlock if the spawned thread > tries to do an import, which can happen in a myriad of ways).
Exactly, :(. I changed timeobject.c to import _strptime once at init time. But the problem still happened, because the function strptime needs to parse the format, and this involves a regex sub() call, which finish in a pattern_subx() call in _srec.c, which needs to call to _subx() in the re module through the call() function, which finally issues another import, creating the deadlock again. In short: you can not avoid a second import unless you rewrite *a lot* of internal code. BTW, I'll leave the optimization of importing strptime one time, there's no reason to try to import it everytime strptime() is called. Regards, -- . Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com