diff options
author | 2011-01-06 00:49:38 +0000 | |
---|---|---|
committer | 2011-01-06 00:49:38 +0000 | |
commit | 4bd81725f2e4933484d8b2539ac9a3e60d130df6 (patch) | |
tree | dcfa1a994b652646c8e995b5d756b5f687ac4656 /Lib/bdb.py | |
parent | test_atexit: fix code saving/restoring stdout and stderr (diff) | |
download | cpython-4bd81725f2e4933484d8b2539ac9a3e60d130df6.tar.gz cpython-4bd81725f2e4933484d8b2539ac9a3e60d130df6.tar.bz2 cpython-4bd81725f2e4933484d8b2539ac9a3e60d130df6.zip |
Issue #10492: bdb.Bdb.run() only traces the execution of the code
And not the compilation (if the input is a string).
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r-- | Lib/bdb.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/bdb.py b/Lib/bdb.py index 9f5e7ae630d..f711004483d 100644 --- a/Lib/bdb.py +++ b/Lib/bdb.py @@ -385,6 +385,8 @@ class Bdb: if locals is None: locals = globals self.reset() + if isinstance(cmd, str): + cmd = compile(cmd, "<string>", "exec") sys.settrace(self.trace_dispatch) try: exec(cmd, globals, locals) |