From 91dd48d018c9a3e32a5262bab845c9f7f53ca864 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Sat, 12 Dec 2015 17:52:10 -0800 Subject: [PATCH] pyamqp: connection can be None in _collect. Closes #2960 --- kombu/transport/pyamqp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kombu/transport/pyamqp.py b/kombu/transport/pyamqp.py index b96837c2..f45e39ed 100644 --- a/kombu/transport/pyamqp.py +++ b/kombu/transport/pyamqp.py @@ -98,7 +98,8 @@ class Transport(base.Transport): return connection.drain_events(**kwargs) def _collect(self, connection): - connection.collect() + if connection is not None: + connection.collect() def establish_connection(self): """Establish connection to the AMQP broker."""