From b46ab844fe082ab00ddab00be13a8ecf57f5087d Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 27 Apr 2018 20:48:38 -0700 Subject: [PATCH] classes: really fix KeyError crashes on duplicate QUIT --- classes.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/classes.py b/classes.py index 701e66b..0ef19e4 100644 --- a/classes.py +++ b/classes.py @@ -589,14 +589,13 @@ class PyLinkNetworkCore(structures.CamelCaseToSnakeCase): del self.channels[c] sid = self.get_server(numeric) - log.debug('Removing client %s from self.users', numeric) + log.debug('(%s) Removing client %s from users index', self.name, numeric) try: del self.users[numeric] + self.servers[sid].users.discard(numeric) except KeyError: log.warning('(%s) Failed to remove %r from users index - possible desync or timing issue? (stray QUIT after KILL)', self.name, numeric, exc_info=True) - log.debug('Removing client %s from self.servers[%s].users', numeric, sid) - self.servers[sid].users.discard(numeric) ## State checking functions def nick_to_uid(self, nick):