Skip to content

[3.7] bpo-35931: Gracefully handle SyntaxError in pdb debug command (GH-11782)#11886

Merged
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-4327705-3.7
Feb 15, 2019
Merged

[3.7] bpo-35931: Gracefully handle SyntaxError in pdb debug command (GH-11782)#11886
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-4327705-3.7

Conversation

@miss-islington

@miss-islington miss-islington commented Feb 15, 2019

Copy link
Copy Markdown
Contributor

Previously, debug print( would cause the interpreter to exit on a SyntaxError whereas print( would properly display the error and return to the pdb prompt.

This patch fixes this by pre-compiling the code before passing it to Pdb.run.

https://bugs.python.org/issue35931
(cherry picked from commit 4327705)

Co-authored-by: Daniel Hahler github@thequod.de

https://bugs.python.org/issue35931

…GH-11782)

Previously, `debug print(` would cause the interpreter to exit on a SyntaxError whereas `print(` would properly display the error and return to the pdb prompt.

This patch fixes this by pre-compiling the code before passing it to `Pdb.run`.

https://bugs.python.org/issue35931
(cherry picked from commit 4327705)

Co-authored-by: Daniel Hahler <github@thequod.de>
@miss-islington

Copy link
Copy Markdown
Contributor Author

@blueyed: Status check is done, and it's a success ✅ .

1 similar comment
@miss-islington

Copy link
Copy Markdown
Contributor Author

@blueyed: Status check is done, and it's a success ✅ .

@miss-islington
miss-islington merged commit 6f35219 into python:3.7 Feb 15, 2019
@miss-islington
miss-islington deleted the backport-4327705-3.7 branch February 15, 2019 21:19
@blueyed

blueyed commented Mar 9, 2019

Copy link
Copy Markdown
Contributor

This breaks the API (you cannot pass in a compile() object anymore), and there is a better patch waiting, which then also should get backported, or this one being reverted.
See https://bugs.python.org/issue35931#msg337575.

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.

5 participants