Browse Source

Do not automatically import zmq

pull/1108/head
Miguel Grinberg 2 years ago
parent
commit
de4d5b51e5
  1. 9
      src/socketio/zmq_manager.py

9
src/socketio/zmq_manager.py

@ -1,11 +1,6 @@
import pickle import pickle
import re import re
try:
import eventlet.green.zmq as zmq
except ImportError:
zmq = None
from .pubsub_manager import PubSubManager from .pubsub_manager import PubSubManager
@ -51,7 +46,9 @@ class ZmqManager(PubSubManager): # pragma: no cover
channel='socketio', channel='socketio',
write_only=False, write_only=False,
logger=None): logger=None):
if zmq is None: try:
from eventlet.green import zmq
except ImportError:
raise RuntimeError('zmq package is not installed ' raise RuntimeError('zmq package is not installed '
'(Run "pip install pyzmq" in your ' '(Run "pip install pyzmq" in your '
'virtualenv).') 'virtualenv).')

Loading…
Cancel
Save