Skip to content

Commit e23fef3

Browse files
author
Michael Klishin
committed
Merge pull request rabbitmq#22 from squaremo/puka-worker
Assign `body` before using it
2 parents 4ea627f + abef35f commit e23fef3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python-puka/worker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
consume_promise = client.basic_consume(queue='task_queue', prefetch_count=1)
1515
while True:
1616
msg_result = client.wait(consume_promise)
17-
print " [x] Received %r" % (msg_result['body'],)
17+
body = msg_result['body']
18+
print " [x] Received %r" % (body,)
1819
time.sleep( body.count('.') )
1920
print " [x] Done"
2021
client.basic_ack(msg_result)

0 commit comments

Comments
 (0)