summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes <johtso@gmail.com>2014-08-14 16:47:22 +0100
committerAsk Solem <ask@celeryproject.org>2014-08-15 14:50:46 +0100
commit2cc557e77d5705417cda84047bf0c976260245b2 (patch)
treece5e471a4898bf69ff87283719a9b3b7e5f9b36d
parent42d763b025f529dc0b61558036225a21435f4f35 (diff)
downloadkombu-2cc557e77d5705417cda84047bf0c976260245b2.tar.gz
Fix autoretry when function is missing dunder props
Fixes #392
-rw-r--r--kombu/connection.py6
-rw-r--r--kombu/tests/test_connection.py1
2 files changed, 3 insertions, 4 deletions
diff --git a/kombu/connection.py b/kombu/connection.py
index 291d680a..1d70988a 100644
--- a/kombu/connection.py
+++ b/kombu/connection.py
@@ -495,9 +495,9 @@ class Connection(object):
create_channel = self.channel
class Revival(object):
- __name__ = fun.__name__
- __module__ = fun.__module__
- __doc__ = fun.__doc__
+ __name__ = getattr(fun, '__name__', None)
+ __module__ = getattr(fun, '__module__', None)
+ __doc__ = getattr(fun, '__doc__', None)
def revive(self, channel):
channels[0] = channel
diff --git a/kombu/tests/test_connection.py b/kombu/tests/test_connection.py
index 6bd3303f..fbe47113 100644
--- a/kombu/tests/test_connection.py
+++ b/kombu/tests/test_connection.py
@@ -418,7 +418,6 @@ class test_Connection(Case):
def test_autoretry(self):
myfun = Mock()
- myfun.__name__ = 'test_autoretry'
self.conn.transport.connection_errors = (KeyError, )