Skip to content

Commit

Permalink
ignore kwarg=None in constrained calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ceesem committed Apr 8, 2024
1 parent 7e878bb commit 0fd88bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion caveclient/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,10 @@ def wrapper(*args, **kwargs):
raise ServerIncompatibilityError(msg)
if kwarg_use_constraints is not None:
for kwarg, kwarg_constraint in kwarg_use_constraints.items():
if _version_fails_constraint(self.server_version, kwarg_constraint):
if kwargs.get(kwarg, None) is None:
# Constaint kwarg is either not set or is None.
continue
elif _version_fails_constraint(self.server_version, kwarg_constraint):
msg = (
f"Use of keyword argument `{kwarg}` in `{method.__name__}` "
"is only permitted "
Expand Down

0 comments on commit 0fd88bd

Please sign in to comment.