From bebdf2e4fff355b9fbf6b5209fdd02a13cd48c01 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 3 Dec 2017 17:46:24 -0800 Subject: [PATCH] IRCNetwork: avoid sending multiple disconnect hooks for one disconnection --- classes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes.py b/classes.py index e1728c4..f89fddd 100644 --- a/classes.py +++ b/classes.py @@ -1419,7 +1419,9 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils): except (OSError, RuntimeError, SystemExit) as e: self._log_connection_error('(%s) Disconnected from IRC:', self.name, exc_info=True) - self.disconnect() + if not self._aborted.is_set(): + self.disconnect() + if not self._run_autoconnect(): return