Add error message to assertion

This commit is contained in:
shadeMe 2023-07-04 17:21:26 +02:00
parent eb1db7b720
commit 725b83bba7
No known key found for this signature in database
GPG Key ID: 6FCA9FC635B2A402

View File

@ -2041,7 +2041,10 @@ class Language:
num_params = len(
inspect.signature(replace_listener_func).parameters
)
assert num_params in (1, 3)
assert num_params in (
1,
3,
), f"'replace_listener' callback expects {num_params} parameters, but we only support one or three"
if num_params == 1:
new_model = replace_listener_func(new_model)
else: