From 54393c736ee6c9eb5e003692df821251b8300f6f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 17 Jul 2024 19:11:03 +0800 Subject: [PATCH] bugfix --- appPublic/registerfunction.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/appPublic/registerfunction.py b/appPublic/registerfunction.py index a932ea3..98db70c 100755 --- a/appPublic/registerfunction.py +++ b/appPublic/registerfunction.py @@ -1,4 +1,4 @@ - +from inspect import isfunction, isroutinefunction from functools import partial from appPublic.Singleton import SingletonDecorator @@ -8,6 +8,9 @@ class RegisterFunction: self.registKW = {} def register(self,name,func): + if not isfunction(func) and not isroutinefunction(func): + error(f'RegisterFunction.register({name}, {func}): func is not a function or routine') + return self.registKW[name] = func def get(self,name):