소스 검색

Resolve ei in formatException. Closes #899

Ask Solem 12 년 전
부모
커밋
80dad7355d
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      celery/utils/log.py

+ 2 - 0
celery/utils/log.py

@@ -74,6 +74,8 @@ class ColorFormatter(logging.Formatter):
         self.use_color = use_color
 
     def formatException(self, ei):
+        if ei and not isinstance(ei, tuple):
+            ei = sys.exc_info()
         r = logging.Formatter.formatException(self, ei)
         if isinstance(r, str) and not is_py3k:
             return safe_str(r)