Explorar o código

Add a sensible __repr__ to ExceptionInfo for easier debugging

Ask Solem %!s(int64=16) %!d(string=hai) anos
pai
achega
197d8880ab
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      celery/datastructures.py

+ 6 - 0
celery/datastructures.py

@@ -73,6 +73,12 @@ class ExceptionInfo(object):
     def __str__(self):
         return str(self.exception)
 
+    def __repr__(self):
+        return "<%s.%s: %s" % (
+                self.__class__.__module__,
+                self.__class__.__name__,
+                str(self.exception))
+
 
 def consume_queue(queue):
     while True: