Merge #12588: [Utils] Remove deprecated PyZMQ call from Python ZMQ example

6058766de 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
pull/11545/merge
Wladimir J. van der Laan 7 years ago
commit d74b01db0c
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D

@ -38,7 +38,7 @@ port = 28332
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)

@ -42,7 +42,7 @@ port = 28332
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)

Loading…
Cancel
Save