From 2cc557e77d5705417cda84047bf0c976260245b2 Mon Sep 17 00:00:00 2001 From: Johannes Date: Thu, 14 Aug 2014 16:47:22 +0100 Subject: Fix autoretry when function is missing dunder props Fixes #392 --- kombu/connection.py | 6 +++--- kombu/tests/test_connection.py | 1 - 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, ) -- cgit v1.2.1