Fix variable argument support in @deprecate_non_keyword_only_args.

Review Request #12720 — Created Nov. 10, 2022 and submitted

Information

RBTools
release-5.x

Reviewers

The @deprecate_non_keyword_only_args decorator had some flaws when
passing in positional arguments as keyword arguments or when passing in
variable positional arguments.

This was happening in part because we treated *args and **kwargs as
standard arguments, and ended up with incorrect offsets in the arguments
passed during a call. These didn't match up. We actually needed to skip
these instead.

We also needed to skip copying over any positional arguments that were
passed as keyword arguments, for similar reasons.

Unit tests passed.

Initially hit these issues in Review Board's upcoming copy of this
function. This is a backport of those fixes, which are confirmed fixed.

Summary ID
Fix variable argument support in @deprecate_non_keyword_only_args.
The `@deprecate_non_keyword_only_args` decorator had some flaws when passing in positional arguments as keyword arguments or when passing in variable positional arguments. This was happening in part because we treated `*args` and `**kwargs` as standard arguments, and ended up with incorrect offsets in the arguments passed during a call. These didn't match up. We actually needed to skip these instead. We also needed to skip copying over any positional arguments that were passed as keyword arguments, for similar reasons.
031d0ae7a7b9a2b01e564c3d9457488cad471720
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.x (a5bfea0)
Loading...