Преглед изворни кода

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