Skip to content

Conversation

@chgnrdv
Copy link
Contributor

@chgnrdvchgnrdv commented Feb 21, 2023

This commit reworks code of '_try_compile' function so that it print shorter traceback if its 'source' argument contains indentation/syntax error
@chgnrdvchgnrdv changed the title gh-102114: Make _try_compile print shorter tracebackgh-102114: Make dis._try_compile print shorter tracebackFeb 21, 2023
@arhadthedevarhadthedev added the stdlib Standard Library Python modules in the Lib/ directory label Feb 21, 2023
Copy link
Member

@iritkatrieliritkatriel 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 PR, your change makes sense. However, we would need a unit test covering this behaviour to prevent future regressions.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@iritkatrieliritkatriel added the 3.12 only security fixes label Apr 6, 2023
chgnrdvand others added 2 commits April 14, 2023 21:02
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Copy link
Member

@iritkatrieliritkatriel left a comment

Choose a reason for hiding this comment

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

Yes, that's better.

@iritkatrieliritkatriel changed the title gh-102114: Make dis._try_compile print shorter tracebackgh-102114: Make dis print more concise tracebacks for syntax errors in str inputsApr 15, 2023
@iritkatrieliritkatriel merged commit 2b6f5c3 into python:mainApr 15, 2023
carljm added a commit to carljm/cpython that referenced this pull request Apr 17, 2023
* main: Remove `expert-*` from `project-updater` GH workflow (python#103579) pythongh-103583: Add codecs and maps to _codecs_* module state (python#103540) pythongh-48330: address review comments to PR-12271 (python#103209) pythongh-103527: Add multibytecodec.h as make dep for _codecs_* (python#103567) pythongh-103553: Improve `test_inspect`: add more assertions, remove unused (python#103554) pythonGH-103517: Improve tests for `pathlib.Path.walk()` (pythonGH-103518) pythongh-102114: Make dis print more concise tracebacks for syntax errors in str inputs (python#102115) pythonGH-78079: Fix UNC device path root normalization in pathlib (pythonGH-102003) pythongh-101517: Add regression test for a lineno bug in try/except* impacting pdb (python#103547) pythongh-103527: Add make deps for _codecs_* and _multibytecodec (python#103528) pythongh-103532: Fix reST syntax in NEWS entry (pythonGH-103544) pythongh-103532: Add NEWS entry (python#103542)
carljm added a commit to carljm/cpython that referenced this pull request Apr 17, 2023
* superopt: update generated cases with new comment review comments Remove `expert-*` from `project-updater` GH workflow (python#103579) pythongh-103583: Add codecs and maps to _codecs_* module state (python#103540) pythongh-48330: address review comments to PR-12271 (python#103209) pythongh-103527: Add multibytecodec.h as make dep for _codecs_* (python#103567) pythongh-103553: Improve `test_inspect`: add more assertions, remove unused (python#103554) pythonGH-103517: Improve tests for `pathlib.Path.walk()` (pythonGH-103518) pythongh-102114: Make dis print more concise tracebacks for syntax errors in str inputs (python#102115) pythonGH-78079: Fix UNC device path root normalization in pathlib (pythonGH-102003) pythongh-101517: Add regression test for a lineno bug in try/except* impacting pdb (python#103547) pythongh-103527: Add make deps for _codecs_* and _multibytecodec (python#103528) pythongh-103532: Fix reST syntax in NEWS entry (pythonGH-103544) pythongh-103532: Add NEWS entry (python#103542)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.12only security fixesstdlibStandard Library Python modules in the Lib/ directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dis._try_compile: traceback printed on error in source argument is too wordy

4 participants

@chgnrdv@bedevere-bot@iritkatriel@arhadthedev