[Python-Dev] test_threaded_import

Jack Jansen jack@oratrix.nl
Wed, 29 Aug 2001 14:29:51 +0200

I spent the last couple of days hunting for the bug in MacPython threaded 
import, but it turned out the bug is in the test harness. (I did find another 
serious bug in the process, so the time wasn't wasted, but still)

The problem is that test_threaded_import cannot run inside an "import". It 
knows this, and so does regrtest, so they run the test after the import by 
calling test_threaded_import.test_main(), which does the actual test.

All good and fine if you run regrtest as a main script from the commandline, 
but of course it breaks if you run autotest, or if you "import regrtest" in an 
interactive window, because in these cases the import in the main thread 
already holds the lock.

I can simply add an "if not verbose", as in test_socketserver, but that isn't 
really the problem. Does anyone know a better solution?
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.cwi.nl/~jack        | ++++ see http://www.xs4all.nl/~tank/ ++++