From e9e614571d6376f1bc82e941edeb0cf11068c711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 12 Sep 2018 20:16:49 +0200 Subject: [PATCH] server: nio API change for error responses. The request type is now an enum. --- matrix/server.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/matrix/server.py b/matrix/server.py index 8fde82b..cc3f94d 100644 --- a/matrix/server.py +++ b/matrix/server.py @@ -35,6 +35,7 @@ from nio import ( TransportResponse, TransportType, RoomMessagesResponse, + RequestType, ) from . import globals as G @@ -753,10 +754,7 @@ class MatrixServer(object): ) # TODO better error handling. - if ( - response.request_info.type == "sync" - or response.request_info.type == "login" - ): + if response.request_info.type in (RequestType.sync, RequestType.login): self.disconnect() def handle_response(self, response):