Skip to content

Commit 6058766

Browse files
committed
Remove deprecated PyZMQ call from Python ZMQ example
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.
1 parent 90a0aed commit 6058766

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

contrib/zmq/zmq_sub.py

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
class ZMQHandler():
4040
def __init__(self):
41-
self.loop = zmq.asyncio.install()
41+
self.loop = asyncio.get_event_loop()
4242
self.zmqContext = zmq.asyncio.Context()
4343

4444
self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)

contrib/zmq/zmq_sub3.4.py

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
class ZMQHandler():
4444
def __init__(self):
45-
self.loop = zmq.asyncio.install()
45+
self.loop = asyncio.get_event_loop()
4646
self.zmqContext = zmq.asyncio.Context()
4747

4848
self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)

0 commit comments

Comments
 (0)