From b0afcc82ee5b28633ae7af904f5495c3cba4829a Mon Sep 17 00:00:00 2001 From: Champgy Date: Sun, 24 Mar 2024 16:20:42 +0800 Subject: [PATCH] fix: the logic for getting the handler --- src/socketio/base_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/socketio/base_server.py b/src/socketio/base_server.py index c3b8591e..d5a353bc 100644 --- a/src/socketio/base_server.py +++ b/src/socketio/base_server.py @@ -226,7 +226,7 @@ def _get_event_handler(self, event, namespace, args): '*' in self.handlers[namespace]: handler = self.handlers[namespace]['*'] args = (event, *args) - elif '*' in self.handlers: + if handler is None and '*' in self.handlers: if event in self.handlers['*']: handler = self.handlers['*'][event] args = (namespace, *args) @@ -245,7 +245,7 @@ def _get_namespace_handler(self, namespace, args): handler = None if namespace in self.namespace_handlers: handler = self.namespace_handlers[namespace] - elif '*' in self.namespace_handlers: + if handler is None and '*' in self.namespace_handlers: handler = self.namespace_handlers['*'] args = (namespace, *args) return handler, args