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

mypy 1.9.0: self check fails with Python 3.11 / 3.12 #17001

Closed
mr-c opened this issue Mar 8, 2024 · 3 comments
Closed

mypy 1.9.0: self check fails with Python 3.11 / 3.12 #17001

mr-c opened this issue Mar 8, 2024 · 3 comments
Labels
bug mypy got something wrong

Comments

@mr-c
Copy link
Contributor

mr-c commented Mar 8, 2024

Bug Report

mypy 1.9.0: self check fails with Python 3.11 / 3.12. This was found while updating the Debian packaging.

To Reproduce

# in a checkout of https://github.com/python/mypy/tree/1.9.0
PYTHONPATH=$PWD python3.11 -m mypy    --config-file mypy_self_check.ini -p mypy
# or
PYTHONPATH=$PWD python3.12 -m mypy    --config-file mypy_self_check.ini -p mypy

Expected Behavior

Success: no issues found in 179 source files or similar

Actual Behavior

mypy/checker.py:540: error: Parenthesized context managers are only supported in Python 3.9 and greater  [syntax]
                return True
                ^
mypy/checker.py:540: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-syntax for more info
Found 1 error in 1 file (errors prevented further checking)

Your Environment

  • Mypy version used: 1.9.0
  • Mypy command-line flags: N/A
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.11.8-3 & 3.12.2-4
@mr-c mr-c added the bug mypy got something wrong label Mar 8, 2024
@JelleZijlstra
Copy link
Member

This was fixed on master (#16949) but unfortunately not in the 1.9.0 branch.

@mr-c
Copy link
Contributor Author

mr-c commented Mar 8, 2024

@JelleZijlstra No worries; thanks for the tip. That PR applies cleanly and I can confirm the fix. I've added that PR as a local patch for the Debian package. I don't think a 1.9.1 release is necessary for this issue, so I'll close it.

@mr-c mr-c closed this as completed Mar 8, 2024
@JelleZijlstra
Copy link
Member

Sounds good. I'll mention this on the release tracking issue, as it would be nice to cherry-pick the fix in if we do end up making a 1.9.1 release for other reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

2 participants