Lit: Rework r249161; Move RLIMIT_NPROC to main.py.
[oota-llvm.git] / utils / lit / lit / run.py
index 8aaf52f1aecdc7d41e5f2e6f2c56fcaa0c02260a..27c414d6dd65e6525cc728ac9a98d90e76931f2c 100644 (file)
@@ -209,14 +209,18 @@ class Run(object):
         """
 
         # Choose the appropriate parallel execution implementation.
+        consumer = None
         if jobs != 1 and use_processes and multiprocessing:
             try:
                 task_impl = multiprocessing.Process
                 queue_impl = multiprocessing.Queue
                 canceled_flag =  multiprocessing.Value('i', 0)
                 consumer = MultiprocessResultsConsumer(self, display, jobs)
-            except ImportError:
-                # Workaround for BSD: http://bugs.python.org/issue3770
+            except:
+                # multiprocessing fails to initialize with certain OpenBSD and
+                # FreeBSD Python versions: http://bugs.python.org/issue3770
+                # Unfortunately the error raised also varies by platform.
+                self.lit_config.note('failed to initialize multiprocessing')
                 consumer = None
         if not consumer:
             task_impl = threading.Thread