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

Cannot parse Python 3.10 keywords Eg: match #2531

Closed
sbalasa opened this issue Oct 7, 2021 · 1 comment
Closed

Cannot parse Python 3.10 keywords Eg: match #2531

sbalasa opened this issue Oct 7, 2021 · 1 comment
Labels
C: parser How we parse code. Or fail to parse it. R: duplicate This issue or pull request already exists T: bug Something isn't working

Comments

@sbalasa
Copy link

sbalasa commented Oct 7, 2021

Describe the bug

Python 3.10 keywords aren't recognized

To Reproduce

Run black when match keyword is present in the file

For example:

  1. Create a file sample.py having match keyword
  2. Run black -l 80 sample.py
  3. See error -->
error: cannot format sample.py: Cannot parse: 2:10:     match option:
Oh no! 💥 💔 💥
1 file failed to reformat.
<img width="603" alt="Screenshot 2021-10-08 at 3 07 19 AM" src="https://user-images.githubusercontent.com/4533119/136465771-59933ab9-0a8e-4fcb-a8ea-6c40ef78639f.png">

Expected behavior

Black formatter should format 3.10 related syntax/keywords too.

Environment (please complete the following information):

  • Version: Big Sur 11.2.3
  • OS and Python version: Mac OS and python3.10

Does this bug also happen on main? Yes

@sbalasa sbalasa added the T: bug Something isn't working label Oct 7, 2021
@sbalasa sbalasa changed the title Python 3.10 keywords aren't recognized Python 3.10 keywords aren't parsed Oct 7, 2021
@sbalasa sbalasa changed the title Python 3.10 keywords aren't parsed Cannot parse Python 3.10 keywords Eg: match Oct 7, 2021
@JelleZijlstra
Copy link
Collaborator

Duplicate of #2242.

@ichard26 ichard26 added C: blib2to3 C: parser How we parse code. Or fail to parse it. R: duplicate This issue or pull request already exists labels Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: parser How we parse code. Or fail to parse it. R: duplicate This issue or pull request already exists T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants