[Utils] Remove deprecated PyZMQ call from Python ZMQ example#12588
[Utils] Remove deprecated PyZMQ call from Python ZMQ example#12588laanwj merged 1 commit intobitcoin:masterfrom
Conversation
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.
|
@kosciej I tried to find documentation describing this change, but Google didn't quite get me there. Do you happen to have a link to the documentation that describes this change? Thanks. |
|
@randolf Changelog for PyZMQ 17.0.0 describes this change in poor wording:
However, in the code of PyZMQ 17 the call to def _deprecated():
if _deprecated.called:
return
_deprecated.called = True
import warnings
warnings.warn("ZMQEventLoop and zmq.asyncio.install are deprecated in pyzmq 17. Special eventloop integration is no longer needed.", DeprecationWarning, stacklevel=3)
_deprecated.called = False
def install():
"""DEPRECATED: No longer needed in pyzmq 17"""
_deprecated()Even the documentation of PyZMQ no longer mentions This makes the example unusable in most recent version of PyZMQ. I can add the condition for newest PyZMQ (and later) to choose right implementation of run-loop, but for the sake of brevity of example I think it's not necessary. |
|
I think this is fine, the example doesn't have to accommodate for every single version. utACK. |
|
utACK 6058766 |
…ample 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
… 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
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.