فهرست منبع

Doh. Wrong use of hasattr

Ask Solem 16 سال پیش
والد
کامیت
256a730700
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      celery/worker.py

+ 1 - 1
celery/worker.py

@@ -250,7 +250,7 @@ class TaskDaemon(object):
     def connection_diagnostics(self):
         """Diagnose the AMQP connection, and reset connection if
         necessary."""
-        if hasattr(self.task_consumer.backend):
+        if hasattr(self.task_consumer, "backend"):
             connection = self.task_consumer.backend.channel.connection
         else:
             connection = self.task_consumer.channel.connection