Skip to content

Commit

Permalink
Remove deprecated PyZMQ call from Python ZMQ example
Browse files Browse the repository at this point in the history
PyZMQ 17.0.0 has deprecated and removed zmq.asyncio.install() call
with advice to use asyncio native run-loop instead of zmq specific.

This caused exception when running the contrib/zmq/zmq_sub*.py examples.

This commit simply follows the advice.
  • Loading branch information
kosciej committed Mar 3, 2018
1 parent 90a0aed commit 6058766
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contrib/zmq/zmq_sub.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

class ZMQHandler():
def __init__(self):
self.loop = zmq.asyncio.install()
self.loop = asyncio.get_event_loop()
self.zmqContext = zmq.asyncio.Context()

self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)
Expand Down
2 changes: 1 addition & 1 deletion contrib/zmq/zmq_sub3.4.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

class ZMQHandler():
def __init__(self):
self.loop = zmq.asyncio.install()
self.loop = asyncio.get_event_loop()
self.zmqContext = zmq.asyncio.Context()

self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)
Expand Down

0 comments on commit 6058766

Please sign in to comment.