From 20d68dfcc07bd389ce2ea7b0773c44d97ebeb68d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 17 Apr 2018 13:38:27 +0200 Subject: [PATCH] pdb.do_debug: handle any exceptions This avoids crashing with e.g. `debug foo(` (which causes a SyntaxError). --- Lib/pdb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/pdb.py b/Lib/pdb.py index 60bdb7675c8131..caa27416b424a1 100755 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -1096,7 +1096,10 @@ def do_debug(self, arg): p = Pdb(self.completekey, self.stdin, self.stdout) p.prompt = "(%s) " % self.prompt.strip() self.message("ENTERING RECURSIVE DEBUGGER") - sys.call_tracing(p.run, (arg, globals, locals)) + try: + sys.call_tracing(p.run, (arg, globals, locals)) + except Exception as exc: + print('Failed to run cmd: %r' % exc) self.message("LEAVING RECURSIVE DEBUGGER") sys.settrace(self.trace_dispatch) self.lastcmd = p.lastcmd 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