diff options
author | Steven Schmid <stevschmid@gmail.com> | 2013-10-24 11:42:49 +0200 |
---|---|---|
committer | Steven Schmid <stevschmid@gmail.com> | 2013-10-24 11:42:49 +0200 |
commit | be4119f84fd56101f6a0acb07ae88f1a4238f322 (patch) | |
tree | 0da95c4f120eedd812be9ac6119743ca2e1327c9 | |
parent | 32b0567343aee7753b2b6be1bc1ee9a69657ba26 (diff) | |
download | websockify-be4119f84fd56101f6a0acb07ae88f1a4238f322.tar.gz |
Fix crash when an import is missing
self.msg is not available when checking the imports.
I had the problem on a host where numpy is missing (python 2.7.3).
-rw-r--r-- | websockify/websocket.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/websockify/websocket.py b/websockify/websocket.py index c40e638..4e28bd2 100644 --- a/websockify/websocket.py +++ b/websockify/websocket.py @@ -58,7 +58,7 @@ for mod, msg in [('numpy', 'HyBi protocol will be slower'), globals()[mod] = __import__(mod) except ImportError: globals()[mod] = None - self.msg("WARNING: no '%s' module, %s", mod, msg) + print("WARNING: no '%s' module, %s" % (mod, msg)) if multiprocessing and sys.platform == 'win32': # make sockets pickle-able/inheritable import multiprocessing.reduction |