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

Crash on parenthesized with statement #54

Closed
antonagestam opened this issue Aug 31, 2022 · 3 comments · Fixed by #1228
Closed

Crash on parenthesized with statement #54

antonagestam opened this issue Aug 31, 2022 · 3 comments · Fixed by #1228
Labels
bug Something isn't working

Comments

@antonagestam
Copy link

antonagestam commented Aug 31, 2022

I tried running ruff on a large project, which resulted in this crash:

[2022-08-31][10:33:40][ruff][ERROR] Failed to check repr-with.py: invalid syntax. Got unexpected token 'as' at line 9 column 13

It seems like the crash happens on parenthesized context managers introduced in Python 3.10. Minimal reproducible example:

from contextlib import contextmanager

@contextmanager
def ctx():
    yield

with (ctx() as foo):
    ...
@charliermarsh
Copy link
Member

Thanks for reporting! Looks like a bug in the parser. I'll look into it :)

@charliermarsh
Copy link
Member

Will come back to this, but reported in the parser here too: RustPython/RustPython#4145

@charliermarsh
Copy link
Member

(This is a blocker for 0.1.0.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants