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

bpo-43859: Improve the error message for IndentationError exceptions #25431

Merged
merged 4 commits into from Apr 21, 2021

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Apr 16, 2021

Grammar/python.gram Outdated Show resolved Hide resolved
Grammar/python.gram Show resolved Hide resolved
Grammar/python.gram Show resolved Hide resolved
Lib/test/test_syntax.py Show resolved Hide resolved
@pablogsal
Copy link
Member Author

Pinging @lysnikolaou and @gvanrossum.

@ammaraskar and some users mentioned that the current IndentationError messages can be quite confusing for newcomers or other developers. I want you to take a look because this is adding a few extra rules and I want your input to check if this is worth the effort.

Copy link
Contributor

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the ping, @pablogsal.

I'm fine with having more rules, but producing better errors. Only one comment: Let's quote the type of the statement in the error message, for example expected an indented block after 'try' statement on line 2

@pablogsal
Copy link
Member Author

@lysnikolaou @ammaraskar Thanks fo the feedback, I have updated the PR to address your comments

Copy link
Contributor

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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.

None yet

5 participants