소스 검색

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