From 4831658b3f6205108707b31ae3acde33165b6b67 Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 19 Apr 2020 23:45:17 +0100 Subject: [PATCH] Fix listener ordering check --- houdini/handlers/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/houdini/handlers/__init__.py b/houdini/handlers/__init__.py index d0de0c9..a0645ba 100644 --- a/houdini/handlers/__init__.py +++ b/houdini/handlers/__init__.py @@ -163,11 +163,11 @@ class _ListenerManager(_AbstractManager): self[listener_object.packet].append(listener_object) for listener_name, listener_object in listener_objects: - if listener_object.before is not None: + if listener_object.before in self[listener_object.packet]: index_of_before = self[listener_object.packet].index(listener_object.before) old_index = self[listener_object.packet].index(listener_object) self[listener_object.packet].insert(index_of_before - 1, self[listener_object.packet].pop(old_index)) - if listener_object.after is not None: + if listener_object.after in self[listener_object.packet]: index_of_after = self[listener_object.packet].index(listener_object.after) old_index = self[listener_object.packet].index(listener_object) self[listener_object.packet].insert(index_of_after + 1, self[listener_object.packet].pop(old_index))