Skip to content

Commit d74b01d

Browse files
committed
Merge #12588: [Utils] Remove deprecated PyZMQ call from Python ZMQ example
6058766 Remove deprecated PyZMQ call from Python ZMQ example (Michał Zabielski) Pull request description: 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 and fixes mentioned examples. Tree-SHA512: af357aafa5eb9506cfa3f513f06979bbc49f6132fddc1e96fbcea175da4f8e2ea298be7c7055e7d3377f0814364e13bb88b5c195f6a07898cd28c341d23a93c5
2 parents cff95a6 + 6058766 commit d74b01d

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)