• 
      

    Use Django's func_accepts_kwargs() for kwargs inspection.

    Review Request #11938 — Created Jan. 19, 2022 and submitted

    Information

    Review Board
    release-4.0.x

    Reviewers

    Django provides a utility function named func_accepts_kwargs(), which
    checks a function's signature to determine if it accepts a **kwargs
    argument.

    We perform this check from time to time, when trying to work around
    legacy extension interfaces. There are currently two cases where we were
    performing this check ourselves using getargspec, which is deprecated
    and warns on Python 3.

    This change switches to Django's method, saving us the deprecation
    warning and slimming down the code.

    There's also an old unused getargspec import that has been removed.

    Unit tests pass.

    Summary ID
    Use Django's func_accepts_kwargs() for kwargs inspection.
    Django provides a utility function named `func_accepts_kwargs()`, which checks a function's signature to determine if it accepts a `**kwargs` argument. We perform this check from time to time, when trying to work around legacy extension interfaces. There are currently two cases where we were performing this check ourselves using `getargspec`, which is deprecated and warns on Python 3. This change switches to Django's method, saving us the deprecation warning and slimming down the code. There's also an old unused `getargspec` import that has been removed.
    45526f24eb0975bbea5d5916dbd8096af8607c95
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-4.0.x (51fd514)