]> granicus.if.org Git - python/commitdiff
Issue #7449, part 4: skip test_multiprocessing if thread support is disabled
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 27 Apr 2010 21:56:26 +0000 (21:56 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 27 Apr 2010 21:56:26 +0000 (21:56 +0000)
import threading after _multiprocessing to raise a more revelant error message:
"No module named _multiprocessing". _multiprocessing is not compiled without
thread support.

Lib/test/test_multiprocessing.py

index 8f32cfba8a7dd080b967e489502a563b56c6c8f3..03629d1b552d37cf36c1ffd27916cf93aa59403b 100644 (file)
@@ -5,7 +5,6 @@
 #
 
 import unittest
-import threading
 import Queue
 import time
 import sys
@@ -18,9 +17,11 @@ import random
 import logging
 from test import test_support
 from StringIO import StringIO
-
-
 _multiprocessing = test_support.import_module('_multiprocessing')
+# import threading after _multiprocessing to raise a more revelant error
+# message: "No module named _multiprocessing". _multiprocessing is not compiled
+# without thread support.
+import threading
 
 # Work around broken sem_open implementations
 test_support.import_module('multiprocessing.synchronize')