Skip to content

Commit

Permalink
Merge pull request #1260 from Cadair/quantity_decorator
Browse files Browse the repository at this point in the history
var args fix for unit decorator
  • Loading branch information
ayshih committed Jan 23, 2015
2 parents 754a015 + c582030 commit c2e18bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sunpy/util/unit_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ def wrapper(*func_args, **func_kwargs):

# Iterate through the parameters of the original signature
for param in wrapped_signature.parameters.values():
# We do not support variable arguments (*args,
# **kwargs)
if param.kind in (funcsigs.Parameter.VAR_KEYWORD,
funcsigs.Parameter.VAR_POSITIONAL):
continue
# Catch the (never triggered) case where bind relied on a default value.
if param.name not in bound_args.arguments and param.default is not param.empty:
bound_args.arguments[param.name] = param.default
Expand Down

0 comments on commit c2e18bc

Please sign in to comment.