From 876a2c8ed03be4320c8894949bfb03b779fccd6a Mon Sep 17 00:00:00 2001 From: Chris Beaven Date: Mon, 19 Oct 2015 10:51:05 +1300 Subject: [PATCH] Missing sys import Also put the error message in sys.exit rather than printing. This will output it to stderr and make the exit code non-zero like it should be. --- lib/websockets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/websockets.py b/lib/websockets.py index 8014ef25..65c9ded9 100644 --- a/lib/websockets.py +++ b/lib/websockets.py @@ -21,8 +21,8 @@ from collections import defaultdict try: from SimpleWebSocketServer import WebSocket, SimpleSSLWebSocketServer except ImportError: - print "install SimpleWebSocketServer" - sys.exit() + import sys + sys.exit("install SimpleWebSocketServer") import util @@ -93,7 +93,7 @@ class WsClientThread(util.DaemonThread): except Queue.Empty: continue id = r.get('id') - if id is None: + if id is None: method = r.get('method') params = r.get('params') else: