소스 검색

celery.execute.trace: Handle raise(str), which is still allowed in Python 2.4. Closes #175. Thanks to psnj.

Ask Solem 14 년 전
부모
커밋
f5ba703a8e
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      celery/execute/trace.py

+ 3 - 0
celery/execute/trace.py

@@ -33,6 +33,9 @@ class TraceInfo(object):
             return cls(states.RETRY, retval=exc, exc_info=sys.exc_info())
         except Exception, exc:
             return cls(states.FAILURE, retval=exc, exc_info=sys.exc_info())
+        except:
+            # For Python2.4 where raising strings are still allowed.
+            return cls(states.FAILURE, retval=None, exc_info=sys.exc_info())
 
 
 class TaskTrace(object):