File avoid-fail-on-reconnect.patch of Package python-amqp
Index: amqp-1.4.9/amqp/connection.py
===================================================================
--- amqp-1.4.9.orig/amqp/connection.py
+++ amqp-1.4.9/amqp/connection.py
@@ -191,9 +191,11 @@ class Connection(AbstractChannel):
def _do_close(self):
try:
- self.transport.close()
+ if self.transport:
+ self.transport.close()
- temp_list = [x for x in values(self.channels) if x is not self]
+ temp_list = [x for x in values(self.channels or {})
+ if x is not self]
for ch in temp_list:
ch._do_close()
except socket.error: