Skip to content

Use inspect.getfullargspec in the PyPy code path - #1096

Open
itzzdev09 wants to merge 1 commit into
getslash:developfrom
itzzdev09:getargspec-removed-in-py311
Open

itzzdev09 wants to merge 1 commit into
getslash:developfrom
itzzdev09:getargspec-removed-in-py311

Conversation

@itzzdev09

Copy link
Copy Markdown

Fixes #1053.

get_arguments() calls inspect.getargspec when running on PyPy. getargspec was removed in Python 3.11, so on a PyPy that follows 3.11 or later every call fails with AttributeError, and get_arguments is used to build fixtures and to check the reporter interface.

This switches that branch to inspect.getfullargspec, which exposes the same .args list that the code reads.

There is no PyPy here, so I added test_get_arguments_pypy_code_path, which sets PYPY = True on CPython to run that branch, for a function, a bound method and an unbound method. It fails without the change (getargspec is gone on 3.12) and passes with it. I ran tests/test_ut_utils.py on Windows with Python 3.12; I did not run the rest of the suite or pylint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove inspect.getargspec from code

1 participant