Переглянути джерело

multiprocessing.cpu_count may raise NotImplementedError. Closes #320. Thanks to thenewguy

Ask Solem 14 роки тому
батько
коміт
20dcdca238
1 змінених файлів з 4 додано та 1 видалено
  1. 4 1
      celery/apps/worker.py

+ 4 - 1
celery/apps/worker.py

@@ -42,7 +42,10 @@ EXTRA_INFO_FMT = """
 
 def cpu_count():
     if multiprocessing is not None:
-        return multiprocessing.cpu_count()
+        try:
+            return multiprocessing.cpu_count()
+        except NotImplementedError:
+            pass
     return 2