diff options
| author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-08 21:27:42 (GMT) |
|---|---|---|
| committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-04-08 21:27:42 (GMT) |
| commit | 4b798bdf8ab3a4a4b3b11ea60a8f0b1c54e43224 (patch) | |
| tree | 2f6d90495b0810238db4e2093acc1536c7b270c7 /Lib/test/test_capi.py | |
| parent | abf8e015c2cd0af1c463eccf371bba003ae538dd (diff) | |
| download | cpython-4b798bdf8ab3a4a4b3b11ea60a8f0b1c54e43224.zip cpython-4b798bdf8ab3a4a4b3b11ea60a8f0b1c54e43224.tar.gz cpython-4b798bdf8ab3a4a4b3b11ea60a8f0b1c54e43224.tar.bz2 | |
Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
suite as a side-effect of importing the module.
- in test_capi, a thread tried to import other modules
- re.compile() imported sre_parse again on every call.
Diffstat (limited to 'Lib/test/test_capi.py')
| -rw-r--r-- | Lib/test/test_capi.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index cdd84bb..eea41c1 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -19,9 +19,6 @@ def test_main(): # some extra thread-state tests driven via _testcapi def TestThreadState(): - import thread - import time - if test_support.verbose: print "auto-thread-state" @@ -45,6 +42,8 @@ def test_main(): have_thread_state = False if have_thread_state: + import thread + import time TestThreadState() import threading t=threading.Thread(target=TestThreadState) |
