From 4382d9100870958c72f1478047beea802579ae97 Mon Sep 17 00:00:00 2001 From: "Vgr E.Barry" Date: Thu, 4 Jun 2015 10:55:53 -0400 Subject: [PATCH] Modify hook handling --- src/decorators.py | 3 --- src/handler.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/decorators.py b/src/decorators.py index a373f94..d4cd46f 100644 --- a/src/decorators.py +++ b/src/decorators.py @@ -181,9 +181,6 @@ class hook: self.__doc__ = self.func.__doc__ return self - def caller(self, *args): - return self.func(*args) - @staticmethod def unhook(hookid): for each in list(HOOKS): diff --git a/src/handler.py b/src/handler.py index 319fbf7..e0d70c4 100644 --- a/src/handler.py +++ b/src/handler.py @@ -94,7 +94,7 @@ def unhandled(cli, prefix, cmd, *args): if isinstance(arg, bytes): largs[i] = arg.decode('ascii') for fn in decorators.HOOKS.get(cmd, []): try: - fn.caller(cli, prefix, *largs) + fn.func(cli, prefix, *largs) except Exception as e: if botconfig.DEBUG_MODE: raise e