[Python-Dev] Cygwin Python 2.1c1 test_threadedtempfile problem

Michael Hudson mwh21@cam.ac.uk
Sat, 14 Apr 2001 11:05:07 +0100 (BST)


On Sat, 14 Apr 2001, Tim Peters wrote:

> So the question is why you're not getting an ImportError on "import
> thread" (try it an interactive Python to make sure that's the cause).  
> Why you're not getting an ImportError I'll have to leave to someone
> who understands the Unix config process.

That one's easy: a testcase earlier has tried to "import threading";
*that* import died with an ImportError when threading tried to import
"thread", and then the "import threading" in
test_threadtempfileorwhatever.py gets the half finished module object that
had been constructed when "import thread" blew up for the first time.

Maybe modules should be removed from sys.modules when they fail to be
imported due to an exception?

Cheers,
M.