bpo-35931: Gracefully handle SyntaxError in pdb debug command by blueyed · Pull Request #11782 · python/cpython

@blueyed

On the pdb prompt `debug print(` currently crashes, but `print(`
displays that there's a SyntaxError.

This patch fixes this by pre-compiling the code for `Pdb.run`.

zware

@blurb-it

@blueyed

blueyed

eamanu

@blueyed

@zware zware changed the title bpo-35931: pdb: do_debug: handle SyntaxError bpo-35931: Gracefully handle SyntaxError in pdb debug command

Feb 15, 2019

@zware

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Feb 15, 2019
…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>

@blueyed blueyed deleted the do_debug-handle-SyntaxError branch

February 15, 2019 21:07

miss-islington added a commit that referenced this pull request

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>

blueyed added a commit to pdbpp/pdbpp that referenced this pull request

Feb 15, 2019

blueyed added a commit to pdbpp/pdbpp that referenced this pull request

Feb 16, 2019

blueyed added a commit to blueyed/rebased-pdbpp that referenced this pull request

May 25, 2019

@blueyed