From be4119f84fd56101f6a0acb07ae88f1a4238f322 Mon Sep 17 00:00:00 2001 From: Steven Schmid Date: Thu, 24 Oct 2013 11:42:49 +0200 Subject: [PATCH] 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). --- websockify/websocket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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