Skip to content

Commit

Permalink
rpc: fix 0-ady functions raising an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
training committed Jan 15, 2024
1 parent f5c96ba commit 1f4e269
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/p4p/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ def _wrapMethod(K, V):
if S.varargs is not None or keywords is not None:
raise TypeError("vararg not supported for proxy method %s" % K)

if len(S.args) != len(S.defaults):
num_args, num_defaults = (0 if v is None else len(v) for v in (S.args, S.defaults))
if num_args != num_defaults:
raise TypeError("proxy method %s must specify types for all arguments" % K)

try:
Expand Down

0 comments on commit 1f4e269

Please sign in to comment.