commit | 4bd81725f2e4933484d8b2539ac9a3e60d130df6 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Thu Jan 06 00:49:38 2011 +0000 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Thu Jan 06 00:49:38 2011 +0000 |
tree | dcfa1a994b652646c8e995b5d756b5f687ac4656 | |
parent | 457ab068a38c806e68e254c65d41c695256e15a0 [diff] |
Issue #10492: bdb.Bdb.run() only traces the execution of the code And not the compilation (if the input is a string).
diff --git a/Lib/bdb.py b/Lib/bdb.py index 9f5e7ae..f711004 100644 --- a/Lib/bdb.py +++ b/Lib/bdb.py
@@ -385,6 +385,8 @@ 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)