diff options
author | Ask Solem <ask@celeryproject.org> | 2012-11-13 13:44:41 +0000 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2012-11-13 13:44:41 +0000 |
commit | f42e5597e110add2a4f1e9102f0844fbdc71cc2c (patch) | |
tree | e2e29b85b5cb283447f1540a4cfc826a0dfac5eb /examples | |
parent | c73865812d55f57a3a1893ebde7a2d304357e4e0 (diff) | |
download | kombu-f42e5597e110add2a4f1e9102f0844fbdc71cc2c.tar.gz |
Revert 7f9b38f... [kombu3] No longer supports Python 2.5
Diffstat (limited to 'examples')
-rw-r--r-- | examples/complete_receive.py | 3 | ||||
-rw-r--r-- | examples/complete_send.py | 2 | ||||
-rw-r--r-- | examples/simple_eventlet_receive.py | 2 | ||||
-rw-r--r-- | examples/simple_eventlet_send.py | 2 | ||||
-rw-r--r-- | examples/simple_receive.py | 3 | ||||
-rw-r--r-- | examples/simple_send.py | 2 | ||||
-rw-r--r-- | examples/simple_task_queue/client.py | 2 | ||||
-rw-r--r-- | examples/simple_task_queue/worker.py | 4 |
8 files changed, 19 insertions, 1 deletions
diff --git a/examples/complete_receive.py b/examples/complete_receive.py index 3d9d44a9..d7c8e948 100644 --- a/examples/complete_receive.py +++ b/examples/complete_receive.py @@ -2,6 +2,9 @@ Example of simple consumer that waits for a single message, acknowledges it and exits. """ + +from __future__ import with_statement + from kombu import Connection, Exchange, Queue, Consumer, eventloop from pprint import pformat diff --git a/examples/complete_send.py b/examples/complete_send.py index 337083c1..c81f8620 100644 --- a/examples/complete_send.py +++ b/examples/complete_send.py @@ -5,6 +5,8 @@ Example producer that sends a single message and exits. You can use `complete_receive.py` to receive the message sent. """ +from __future__ import with_statement + from kombu import Connection, Producer, Exchange, Queue #: By default messages sent to exchanges are persistent (delivery_mode=2), diff --git a/examples/simple_eventlet_receive.py b/examples/simple_eventlet_receive.py index d70126df..1f88e713 100644 --- a/examples/simple_eventlet_receive.py +++ b/examples/simple_eventlet_receive.py @@ -6,6 +6,8 @@ You can use `simple_receive.py` (or `complete_receive.py`) to receive the message sent. """ +from __future__ import with_statement + import eventlet from Queue import Empty diff --git a/examples/simple_eventlet_send.py b/examples/simple_eventlet_send.py index 1ba87fbf..f6259bf3 100644 --- a/examples/simple_eventlet_send.py +++ b/examples/simple_eventlet_send.py @@ -6,6 +6,8 @@ You can use `simple_receive.py` (or `complete_receive.py`) to receive the message sent. """ +from __future__ import with_statement + import eventlet from kombu import Connection diff --git a/examples/simple_receive.py b/examples/simple_receive.py index e15427e3..e9b933b1 100644 --- a/examples/simple_receive.py +++ b/examples/simple_receive.py @@ -1,6 +1,9 @@ """ Example receiving a message using the SimpleQueue interface. """ + +from __future__ import with_statement + from kombu import Connection #: Create connection diff --git a/examples/simple_send.py b/examples/simple_send.py index 3b3f236e..e76fbcf0 100644 --- a/examples/simple_send.py +++ b/examples/simple_send.py @@ -6,6 +6,8 @@ You can use `simple_receive.py` (or `complete_receive.py`) to receive the message sent. """ +from __future__ import with_statement + from kombu import Connection #: Create connection diff --git a/examples/simple_task_queue/client.py b/examples/simple_task_queue/client.py index 8ed33f36..fe0a512b 100644 --- a/examples/simple_task_queue/client.py +++ b/examples/simple_task_queue/client.py @@ -1,3 +1,5 @@ +from __future__ import with_statement + from kombu.common import maybe_declare from kombu.pools import producers diff --git a/examples/simple_task_queue/worker.py b/examples/simple_task_queue/worker.py index 807542e9..be241140 100644 --- a/examples/simple_task_queue/worker.py +++ b/examples/simple_task_queue/worker.py @@ -1,3 +1,5 @@ +from __future__ import with_statement + from kombu.mixins import ConsumerMixin from kombu.log import get_logger from kombu.utils import kwdict, reprcall @@ -23,7 +25,7 @@ class Worker(ConsumerMixin): logger.info('Got task: %s', reprcall(fun.__name__, args, kwargs)) try: fun(*args, **kwdict(kwargs)) - except Exception as exc: + except Exception, exc: logger.error('task raised exception: %r', exc) message.ack() |