فهرست منبع

Fix for running celery on windows. Removed reaping of processes if os.kill() function doesn't exist.

Jonatan Heyman 15 سال پیش
والد
کامیت
65da4070be
1فایلهای تغییر یافته به همراه4 افزوده شده و 3 حذف شده
  1. 4 3
      celery/pool.py

+ 4 - 3
celery/pool.py

@@ -65,11 +65,12 @@ def process_is_dead(process):
     :returns: ``True`` if the process is not running, ``False`` otherwise.
 
     """
-
+    
     # Try to see if the process is actually running,
     # and reap zombie proceses while we're at it.
-
-    if reap_process(process.pid):
+    # Only do this if os.kill exists. It doesn't on windows.
+    
+    if callable(getattr(os, "kill", None)) and reap_process(process.pid):
         return True
 
     # Then try to ping the process using its pipe.