diff options
| author | tpavelchak | 2019-10-18 16:21:47 +0300 |
|---|---|---|
| committer | jason | 2019-10-25 10:35:58 -0600 |
| commit | 3a536e184309f04a4ffe9dff446207e7267f2f99 (patch) | |
| tree | a186e5dc5827358afbf0d93d49075ceef9da1f46 | |
| parent | 9cb7b0e7d44b8dfe5eaf2d7df133a67e072e9481 (diff) | |
| download | eventmq-3a536e184309f04a4ffe9dff446207e7267f2f99.tar.gz eventmq-3a536e184309f04a4ffe9dff446207e7267f2f99.zip | |
Update print, xrange and unicode functions for python 2/3 compatibility
| -rw-r--r-- | bin/logwatcher.py | 2 | ||||
| -rw-r--r-- | eventmq/subscriber.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/bin/logwatcher.py b/bin/logwatcher.py index dd2860f..1abeb4a 100644 --- a/bin/logwatcher.py +++ b/bin/logwatcher.py | |||
| @@ -13,4 +13,4 @@ while True: | |||
| 13 | 13 | ||
| 14 | if events.get(s) == zmq.POLLIN: | 14 | if events.get(s) == zmq.POLLIN: |
| 15 | msg = s.recv_multipart() | 15 | msg = s.recv_multipart() |
| 16 | print msg # noqa | 16 | print(msg) # noqa |
diff --git a/eventmq/subscriber.py b/eventmq/subscriber.py index f585572..ef1aa0b 100644 --- a/eventmq/subscriber.py +++ b/eventmq/subscriber.py | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | """ | 1 | """ |
| 2 | derp subscriber | 2 | derp subscriber |
| 3 | """ | 3 | """ |
| 4 | from past.builtins import xrange | ||
| 4 | import zmq | 5 | import zmq |
| 5 | 6 | ||
| 6 | 7 | ||
| @@ -18,4 +19,4 @@ if __name__ == "__main__": | |||
| 18 | # block until something comes in. normally you'd do something with | 19 | # block until something comes in. normally you'd do something with |
| 19 | # this in another thread or something | 20 | # this in another thread or something |
| 20 | for s in sockets: | 21 | for s in sockets: |
| 21 | print s.recv_multipart() # noqa | 22 | print(s.recv_multipart()) # noqa |