Skip to content

Commit

Permalink
fixed bug with debug mode
Browse files Browse the repository at this point in the history
using `assert msg.pop(0) == ''` shows different behaviours depending on whether you run the code with `python -O` or simply with `python` (differently said, if you run in debug mode or not...).

In particular when not in debug mode with `worker.recv()` you get a `request` obejct starting with an empty element.
  • Loading branch information
splendido committed Mar 11, 2015
1 parent 80f5af2 commit 2cf92cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/Python/mdwrkapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ def recv(self, reply=None):
# up to a null part, but for now, just save one...
self.reply_to = msg.pop(0)
# pop empty
assert msg.pop(0) == ''
empty = msg.pop(0)
assert empty == ''

return msg # We have a request to process
elif command == MDP.W_HEARTBEAT:
Expand Down

0 comments on commit 2cf92cb

Please sign in to comment.