瀏覽代碼

fix import error in python 2.5

3.0.x are the last versions to support python 2.5.  Erroneous import was introduced with a fix for issue #1107
Adrian Rego 12 年之前
父節點
當前提交
49c09df47a
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      celery/__compat__.py

+ 6 - 1
celery/__compat__.py

@@ -14,7 +14,12 @@ from __future__ import absolute_import
 import operator
 import sys
 
-from functools import reduce
+# import fails in python 2.5. fallback to reduce in stdlib
+try:
+    from functools import reduce
+except ImportError:
+    pass
+
 from importlib import import_module
 from types import ModuleType