Skip to content

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

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

Merged
merged 1 commit into from
Feb 15, 2019

Conversation

miss-islington
Copy link
Contributor

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

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
Contributor Author

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

1 similar comment
@miss-islington
Copy link
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
Copy link
Contributor

blueyed commented Mar 9, 2019

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy