only bound methods pls

This commit is contained in:
Benedikt Bartscher 2024-11-10 23:26:12 +01:00
parent 3f139e3209
commit c9df58860b
No known key found for this signature in database

View File

@ -1345,8 +1345,8 @@ def check_fn_match_arg_spec(
EventFnArgMismatch: Raised if the number of mandatory arguments do not match EventFnArgMismatch: Raised if the number of mandatory arguments do not match
""" """
user_args = inspect.getfullargspec(user_func).args user_args = inspect.getfullargspec(user_func).args
# Drop the first argument if it's a method # Drop the first argument if it's a bound method
if inspect.ismethod(user_func): if inspect.ismethod(user_func) and user_func.__self__ is not None:
user_args = user_args[1:] user_args = user_args[1:]
user_default_args = inspect.getfullargspec(user_func).defaults user_default_args = inspect.getfullargspec(user_func).defaults