From 321c8baebbae83bb25e2d8c545c7060655fb2a85 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Sun, 27 Nov 2011 17:51:06 +0000 Subject: [PATCH] Fixes 'function object has no attribute "close"'. Closes #78 --- kombu/connection.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kombu/connection.py b/kombu/connection.py index a5d8881f..f59c65ff 100644 --- a/kombu/connection.py +++ b/kombu/connection.py @@ -706,7 +706,10 @@ class Resource(object): dres = dirty.pop() except KeyError: break - self.close_resource(dres) + try: + self.close_resource(dres) + except AttributeError: # Issue #78 + pass mutex = getattr(resource, "mutex", None) if mutex: @@ -717,7 +720,10 @@ class Resource(object): res = resource.queue.pop() except IndexError: break - self.close_resource(res) + try: + self.close_resource(res) + except AttributeError: + pass # Issue #78 finally: if mutex: mutex.release()