Przeglądaj źródła

PyPy: Disable pool by default

Ask Solem 14 lat temu
rodzic
commit
0b5134d42a
2 zmienionych plików z 8 dodań i 2 usunięć
  1. 6 1
      celery/app/defaults.py
  2. 2 1
      setup.py

+ 6 - 1
celery/app/defaults.py

@@ -3,8 +3,13 @@ import sys
 from datetime import timedelta
 
 is_jython = sys.platform.startswith("java")
+is_pypy = hasattr(sys, "pypy_version_info")
 
-DEFAULT_POOL = is_jython and "threads" or "processes"
+DEFAULT_POOL = "processes"
+if is_jython:
+    DEFAULT_POOL = "threads"
+elif is_pypy:
+    DEFAULT_POOL = "solo"
 
 DEFAULT_PROCESS_LOG_FMT = """
     [%(asctime)s: %(levelname)s/%(processName)s] %(message)s

+ 2 - 1
setup.py

@@ -55,7 +55,8 @@ install_requires.extend([
 ])
 py_version = sys.version_info
 is_jython = sys.platform.startswith("java")
-if sys.version_info < (2, 6) and not is_jython:
+is_pypy = hasattr(sys, "pypy_version_info")
+if sys.version_info < (2, 6) and not (is_jython or is_pypy):
     install_requires.append("multiprocessing")
 if sys.version_info < (2, 5):
     install_requires.append("uuid")