🐛 fix got handler running more than once

This commit is contained in:
yanyongyu
2021-08-16 16:47:57 +08:00
parent 57a60ae45b
commit 3d4d3b0f24
2 changed files with 8 additions and 3 deletions

View File

@ -456,7 +456,8 @@ class Matcher(metaclass=MatcherMeta):
parser_handler = cls.append_handler(_key_parser)
def _decorator(func: T_Handler) -> T_Handler:
if not hasattr(cls.handlers[-1], "__wrapped__"):
print("deco", key, hasattr(cls.handlers[-1].func, "__wrapped__"))
if not hasattr(cls.handlers[-1].func, "__wrapped__"):
parser = cls.handlers.pop()
func_handler = Handler(func)