From c01f03a0b72353a8a3bffe8f7878970ea8b6e290 Mon Sep 17 00:00:00 2001 From: Frankie Fisher Date: Fri, 21 Jun 2019 16:12:34 +0100 Subject: [PATCH] Fix regression with recent websockets - tested with 0.37.0 and 0.56.0 --- screepsapi/screepsapi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/screepsapi/screepsapi.py b/screepsapi/screepsapi.py index 91d25a6..95a2b53 100644 --- a/screepsapi/screepsapi.py +++ b/screepsapi/screepsapi.py @@ -382,10 +382,10 @@ def connect(self): url = 'wss://screeps.com/ptr/socket/websocket' self.ws = websocket.WebSocketApp(url=url, - on_message=self.on_message, - on_error=self.on_error, - on_close=self.on_close, - on_open=self.on_open) + on_message=lambda ws, message: self.on_message(ws,message), + on_error=lambda ws, error: self.on_error(ws,error), + on_close=lambda ws: self.on_close(ws), + on_open=lambda ws: self.on_open(ws)) ssl_defaults = ssl.get_default_verify_paths() sslopt_ca_certs = {'ca_certs': ssl_defaults.cafile}