Skip to content

Commit

Permalink
Do not show simple-websocket install prompt if it is already installed
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed May 22, 2021
1 parent 22a7ea4 commit 03a52c8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions flask_socketio/__init__.py
Expand Up @@ -582,9 +582,12 @@ def run(self, app, host=None, port=None, **kwargs):
self.sockio_mw.wsgi_app, evalex=True)

if self.server.eio.async_mode == 'threading':
from werkzeug._internal import _log
_log('warning', 'WebSocket transport not available. Install '
'simple-websocket for improved performance.')
try:
import simple_websocket
except ImportError:
from werkzeug._internal import _log
_log('warning', 'WebSocket transport not available. Install '
'simple-websocket for improved performance.')
app.run(host=host, port=port, threaded=True,
use_reloader=use_reloader, **kwargs)
elif self.server.eio.async_mode == 'eventlet':
Expand Down

0 comments on commit 03a52c8

Please sign in to comment.