aboutsummaryrefslogtreecommitdiff
path: root/contrib/zmq
diff options
context:
space:
mode:
authorMichał Zabielski <zabielski.michal@gmail.com>2018-03-03 06:05:53 +0100
committerMichał Zabielski <zabielski.michal@gmail.com>2018-03-03 06:05:53 +0100
commit6058766de4b717aed7137b70f9384f35231739d9 (patch)
tree22f0a3ca4d109d1d3a5026a89bc3ba2b5ca43265 /contrib/zmq
parent90a0aed51194ad82da8e011b96f9561c685e40b7 (diff)
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.
Diffstat (limited to 'contrib/zmq')
-rw-r--r--[-rwxr-xr-x]contrib/zmq/zmq_sub.py2
-rw-r--r--[-rwxr-xr-x]contrib/zmq/zmq_sub3.4.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/contrib/zmq/zmq_sub.py b/contrib/zmq/zmq_sub.py
index 6e44c56f52..60768dc59a 100755..100644
--- a/contrib/zmq/zmq_sub.py
+++ b/contrib/zmq/zmq_sub.py
@@ -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)
diff --git a/contrib/zmq/zmq_sub3.4.py b/contrib/zmq/zmq_sub3.4.py
index 536352d5ff..0df843c9a3 100755..100644
--- a/contrib/zmq/zmq_sub3.4.py
+++ b/contrib/zmq/zmq_sub3.4.py
@@ -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)