Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ast.Str] Use ast.Constant instead pending removal in python 3.14 #11089

Conversation

Pierre-Sassoulas
Copy link
Member

Pytest start raising deprecation warning in its own code when launched with python 3.12:

  File "/home/runner/work/astroid/astroid/venv/lib/python3.12/site-packages/_pytest/assertion/rewrite.py", line 683, in run
    and isinstance(item.value, ast.Str)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/ast.py", line 555, in __instancecheck__
    warnings._deprecated(
  File "/opt/hostedtoolcache/Python/3.12.0-beta.1/x64/lib/python3.12/warnings.py", line 529, in _deprecated
    warn(msg, DeprecationWarning, stacklevel=3)
DeprecationWarning: ast.Str is deprecated and will be removed in Python 3.14; use ast.Constant instead

See https://github.com/pylint-dev/astroid/actions/runs/5196979689/jobs/9371270546?pr=2199. I'm not sure if ast.Str and ast.Constant are really equivalent so I'm opening the PR to launch the CI and see.

@Pierre-Sassoulas
Copy link
Member Author

How about waiting 3 weeks for python 3.7 EOL 😄 ?

@The-Compiler
Copy link
Member

Thanks for the contribution! However, this is already being fixed as part of #10894, so I'm closing this as a duplicate.

@Pierre-Sassoulas Pierre-Sassoulas deleted the fix-deprecation-warning-from-ast.Str branch June 7, 2023 10:27
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.

2 participants