mirror of https://github.com/python/cpython.git
Issue #1786 (by myself): pdb should use its own stdin/stdout around an
exec call and when creating a recursive instance.
This commit is contained in:
parent
7b1e917e41
commit
cad3724352
10
Lib/pdb.py
10
Lib/pdb.py
|
@ -199,7 +199,13 @@ def default(self, line):
|
||||||
globals = self.curframe.f_globals
|
globals = self.curframe.f_globals
|
||||||
try:
|
try:
|
||||||
code = compile(line + '\n', '<stdin>', 'single')
|
code = compile(line + '\n', '<stdin>', 'single')
|
||||||
exec code in globals, locals
|
try:
|
||||||
|
sys.stdin = self.stdin
|
||||||
|
sys.stdout = self.stdout
|
||||||
|
exec code in globals, locals
|
||||||
|
finally:
|
||||||
|
sys.stdout = save_stdout
|
||||||
|
sys.stdin = save_stdin
|
||||||
except:
|
except:
|
||||||
t, v = sys.exc_info()[:2]
|
t, v = sys.exc_info()[:2]
|
||||||
if type(t) == type(''):
|
if type(t) == type(''):
|
||||||
|
@ -659,7 +665,7 @@ def do_debug(self, arg):
|
||||||
sys.settrace(None)
|
sys.settrace(None)
|
||||||
globals = self.curframe.f_globals
|
globals = self.curframe.f_globals
|
||||||
locals = self.curframe.f_locals
|
locals = self.curframe.f_locals
|
||||||
p = Pdb()
|
p = Pdb(self.completekey, self.stdin, self.stdout)
|
||||||
p.prompt = "(%s) " % self.prompt.strip()
|
p.prompt = "(%s) " % self.prompt.strip()
|
||||||
print >>self.stdout, "ENTERING RECURSIVE DEBUGGER"
|
print >>self.stdout, "ENTERING RECURSIVE DEBUGGER"
|
||||||
sys.call_tracing(p.run, (arg, globals, locals))
|
sys.call_tracing(p.run, (arg, globals, locals))
|
||||||
|
|
|
@ -358,11 +358,15 @@ Core and builtins
|
||||||
|
|
||||||
- Bug #1664966: Fix crash in exec if Unicode filename can't be decoded.
|
- Bug #1664966: Fix crash in exec if Unicode filename can't be decoded.
|
||||||
|
|
||||||
- Issue #1537: Changed GeneratorExit's base class from Exception to BaseException.
|
- Issue #1537: Changed GeneratorExit's base class from Exception to
|
||||||
|
BaseException.
|
||||||
|
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #1786: pdb should use its own stdin/stdout around an exec call
|
||||||
|
and when creating a recursive instance.
|
||||||
|
|
||||||
- Issue #1698398 Zipfile.printdir() crashed because the format string
|
- Issue #1698398 Zipfile.printdir() crashed because the format string
|
||||||
expected a tuple type of length six instead of time.struct_time object.
|
expected a tuple type of length six instead of time.struct_time object.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue