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

@pablogsal pablogsal force-pushed the pablogsal:bpo-43859 branch from b188f3f to 6984a96 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

@pablogsal pablogsal commented Apr 19, 2021

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

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

@pablogsal pablogsal commented Apr 21, 2021

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

…tionError exceptions
Copy link
Contributor

@lysnikolaou lysnikolaou left a comment

LGTM!

@pablogsal pablogsal merged commit 56c95df into python:master Apr 21, 2021
12 checks passed
12 checks passed
Docs
Details
Check for source changes
Details
Check if generated files are up to date
Details
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu
Details
Ubuntu SSL tests with OpenSSL ${{ matrix.openssl_ver }}
Details
Azure Pipelines PR #20210421.20 succeeded
Details
Travis CI - Pull Request Build Passed
Details
bedevere/issue-number Issue number 43859 found
Details
bedevere/news News entry found in Misc/NEWS.d
@pablogsal pablogsal deleted the pablogsal:bpo-43859 branch Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants