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

Detect '@' dotted_name '(' ')' NEWLINE as a simple decorator #2182

Merged
merged 1 commit into from May 4, 2021

Conversation

ichard26
Copy link
Collaborator

@ichard26 ichard26 commented May 3, 2021

Previously the RELAXED_DECORATOR detection would be falsely True on that
example. The problem was that an argument-less parentheses pair didn't
pass the is_simple_decorator_trailer check even it should. OTOH a
parentheses pair containing an argument or more passed as expected.

Fixes #2181

I whipped up this fix really quickly so apologies if this fix is garbage :)

@ichard26 ichard26 force-pushed the fix-relaxed-decorator-detection branch from dc6404b to c2a6c26 Compare May 3, 2021 03:29
Previously the RELAXED_DECORATOR detection would be falsely True on that
example. The problem was that an argument-less parentheses pair didn't
pass the `is_simple_decorator_trailer` check even it should. OTOH a
parentheses pair containing an argument or more passed as expected.
@ichard26 ichard26 force-pushed the fix-relaxed-decorator-detection branch from c2a6c26 to 776aa2f Compare May 3, 2021 03:31
@ichard26
Copy link
Collaborator Author

ichard26 commented May 3, 2021

Cancelled the 3.9 fuzz workflow cause it was getting stuck on Setup Python and then also seemed to exhibit the same behavior that leads to it taking forever and then failing. All of the other runs are passing just fine anyway...

@ambv ambv merged commit e42f992 into psf:master May 4, 2021
@ichard26 ichard26 deleted the fix-relaxed-decorator-detection branch May 4, 2021 13:17
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.

False-alarm in RELAXED_DECORATORS detection breaks compatibility with Python < 3.9
3 participants