diff options
Diffstat (limited to 'pint/registry_helpers.py')
-rw-r--r-- | pint/registry_helpers.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pint/registry_helpers.py b/pint/registry_helpers.py index 38f6b73..548fd65 100644 --- a/pint/registry_helpers.py +++ b/pint/registry_helpers.py @@ -168,9 +168,12 @@ def wraps(ureg, ret, args, strict=True): result = func(*new_values, **kw) + # if more results than return units, append None so extra results are not tuncated + extra_results = (None, ) * (len(result) - len(ret)) + if container: out_units = (_replace_units(r, values_by_name) if is_ref else r - for (r, is_ref) in ret) + for (r, is_ref) in ret + extra_results) return ret.__class__(res if unit is None else ureg.Quantity(res, unit) for unit, res in zip(out_units, result)) |