From cf2fcf926306b9fe8755fe0058718f72f57492ef Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 9 Jan 2016 20:23:23 -0800 Subject: [PATCH] classes.Irc: only allow one shutdown sequence at a time (#152) --- classes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes.py b/classes.py index 581da8b..8660f25 100644 --- a/classes.py +++ b/classes.py @@ -227,7 +227,11 @@ class Irc(): # exception, meaning we've disconnected! log.warning('(%s) Disconnected from IRC: %s: %s', self.name, type(e).__name__, str(e)) - self.disconnect() + + if not self.aborted.is_set(): + # Only start a disconnection process if one doesn't already + # exist. + self.disconnect() # Internal hook signifying that a network has disconnected. self.callHooks([None, 'PYLINK_DISCONNECT', {}])