diff --git a/kombu/tests/transport/test_pyamqp.py b/kombu/tests/transport/test_pyamqp.py index 69af0c87..181cfcf4 100644 --- a/kombu/tests/transport/test_pyamqp.py +++ b/kombu/tests/transport/test_pyamqp.py @@ -44,7 +44,7 @@ class test_Channel(TestCase): pass self.conn = Mock() - self.conn._get_free_channel_id.side_effect = partial(next, count(0)) + self.conn._get_free_channel_id.side_effect = count(0).next self.conn.channels = {} self.channel = Channel(self.conn, 0) diff --git a/kombu/utils/__init__.py b/kombu/utils/__init__.py index 7c4acbe7..5ab709fd 100644 --- a/kombu/utils/__init__.py +++ b/kombu/utils/__init__.py @@ -224,7 +224,7 @@ def retry_over_time(fun, catch, args=[], kwargs={}, errback=None, if callback: callback() tts = (errback(exc, interval_range, retries) if errback - else next(interval_range)) + else interval_range.next()) if tts: for i in range(int(tts / interval_step)): if callback: