From 9b27ca2e34796d5aec42b982ecceddf6c5b65f69 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Sun, 17 Sep 2017 16:20:10 +0100 Subject: [PATCH] fix logoff() hanging in certain cases --- steam/client/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/steam/client/__init__.py b/steam/client/__init__.py index c5f4c3c..c3c0711 100644 --- a/steam/client/__init__.py +++ b/steam/client/__init__.py @@ -554,7 +554,10 @@ class SteamClient(CMClient, BuiltinBase): if self.logged_on: self.logged_on = False self.send(MsgProto(EMsg.ClientLogOff)) - self.wait_event('disconnected') + try: + self.wait_event(self.EVENT_DISCONNECTED, timeout=5, raises=True) + except: + self.disconnect() self.idle() def run_forever(self):