projects
/
mdis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
804a67d
)
dispatcher: determine function argument count via inspect
author
Dmitry Selyutin
<ghostmansd@gmail.com>
Wed, 28 Jun 2023 19:28:17 +0000
(22:28 +0300)
committer
Dmitry Selyutin
<ghostmansd@gmail.com>
Wed, 28 Jun 2023 19:28:17 +0000
(22:28 +0300)
src/mdis/dispatcher.py
patch
|
blob
|
history
diff --git
a/src/mdis/dispatcher.py
b/src/mdis/dispatcher.py
index 63b1ebb0888b53be59d4b16829fdc9e5715e48c7..8455039ce298d31637bd6b8c584bc3840c53b5ec 100644
(file)
--- a/
src/mdis/dispatcher.py
+++ b/
src/mdis/dispatcher.py
@@
-34,9
+34,9
@@
class Hook(object):
def __call__(self, call):
class ConcreteHook(Hook):
def __call__(self, dispatcher, node, *arguments):
-
try
:
+
if (len(inspect.signature(call).parameters) > 2)
:
return call(dispatcher, node, *arguments)
- e
xcept TypeError
:
+ e
lse
:
return call(dispatcher, node)
return ConcreteHook(*tuple(self))