diff options
author | Ask Solem <ask@celeryproject.org> | 2012-09-11 17:32:00 +0100 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2012-09-11 17:33:46 +0100 |
commit | 2fa467ac2dac12fed3680bf99d2efa97eb479fa0 (patch) | |
tree | 25438fa7638630451237791c66a93988284f68ba /kombu/utils/compat.py | |
parent | ae51d2f654a6bad1d48434ea9c964a27d605f166 (diff) | |
download | kombu-2fa467ac2dac12fed3680bf99d2efa97eb479fa0.tar.gz |
Connection: Support for multiple URLs and failover.
Either::
Connection(['amqp://foo', 'amqp://bar'])
or:
Connection('amqp://foo;amqp://bar')
Fixes celery/celery#616
Diffstat (limited to 'kombu/utils/compat.py')
-rw-r--r-- | kombu/utils/compat.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kombu/utils/compat.py b/kombu/utils/compat.py index c1b3cec4..d695728c 100644 --- a/kombu/utils/compat.py +++ b/kombu/utils/compat.py @@ -10,6 +10,18 @@ Helps compatibility with older Python versions. """ import sys +############## __builtins__.next ############################################# +try: + next = next +except NameError: + def next(it, *args): # noqa + try: + return it.__next__() + except StopIteration: + if not args: + raise + return args[0] + ############## collections.OrderedDict ####################################### import weakref |