summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsk Solem <ask@celeryproject.org>2011-11-27 16:32:19 +0000
committerAsk Solem <ask@celeryproject.org>2011-11-27 16:32:19 +0000
commit16759ac7c1322224646f59df76c5e63fb6468300 (patch)
tree8549990205994d63c4f40009c6aa5114aa007231
parent78dfb865c893108227f4afa7a75901fa4d2f663f (diff)
downloadkombu-16759ac7c1322224646f59df76c5e63fb6468300.tar.gz
kombu.compat: Don't close None channel
-rw-r--r--kombu/compat.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/kombu/compat.py b/kombu/compat.py
index ac570573..ef73c3d7 100644
--- a/kombu/compat.py
+++ b/kombu/compat.py
@@ -61,8 +61,9 @@ class Publisher(messaging.Producer):
return self.publish(*args, **kwargs)
def close(self):
- if not self._provided_channel:
+ if self.channel is not None and not self._provided_channel:
self.channel.close()
+ super(Publisher, self).close()
self._closed = True
def __enter__(self):