This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pablogsal
Recipients jfine2358, lys.nikolaou, pablogsal
Date 2022-03-03.15:27:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646321274.9.0.361584154759.issue46910@roundup.psfhosted.org>
In-reply-to
Content
Unfortunately, we cannot do much here. The reason is that the parser allows break and continue outside loops as they count as statements. As these are associated with control flow, is the compiler the one that will show the Syntax warning once it tries to make sense of the abstract syntax tree that the parser generates.

The error you are getting happens because for the parser, the unindented else *is* a syntax error so it fails much sooner and prevents the compiler to complain about the break.

This means that in the presence of two syntax errors, one being a parser error and the other a compiler error, the parser will always be first, no matter if the other one appears before in the code.

Given this, I am afraid we need to close this issue as "won't fix" :(

Bing said that, if someone devises some easy way to do this without major changes everywhere, I am happy to reopen it
History
Date User Action Args
2022-03-03 15:27:54pablogsalsetrecipients: + pablogsal, lys.nikolaou, jfine2358
2022-03-03 15:27:54pablogsalsetmessageid: <1646321274.9.0.361584154759.issue46910@roundup.psfhosted.org>
2022-03-03 15:27:54pablogsallinkissue46910 messages
2022-03-03 15:27:54pablogsalcreate