From 73d54b57888f989ff1e2206317afcf0f9f8c30f2 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 15 Mar 2020 16:13:58 -0400 Subject: [PATCH] Don't show CancelledError when logging out early --- src/backend/matrix_client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index a7c23c71..ff6e2f51 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -213,6 +213,9 @@ class MatrixClient(nio.AsyncClient): def on_profile_response(future) -> None: """Update our model `Account` with the received profile details.""" + if future.cancelled(): # Account logged out + return + exception = future.exception() if exception: @@ -232,6 +235,9 @@ class MatrixClient(nio.AsyncClient): def on_server_config_response(future) -> None: """Update our model `Account` with the received config details.""" + if future.cancelled(): # Account logged out + return + exception = future.exception() if exception: