From: Victor Stinner Date: Thu, 6 Jan 2011 00:49:38 +0000 (+0000) Subject: Issue #10492: bdb.Bdb.run() only traces the execution of the code X-Git-Tag: v3.2rc1~161 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4bd81725f2e4933484d8b2539ac9a3e60d130df6;p=python 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 9f5e7ae630..f711004483 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, "", "exec") sys.settrace(self.trace_dispatch) try: exec(cmd, globals, locals) diff --git a/Misc/NEWS b/Misc/NEWS index cd55adb06c..3cd9257d7b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -30,6 +30,9 @@ Core and Builtins Library ------- +- Issue #10492: bdb.Bdb.run() only traces the execution of the code, not the + compilation (if the input is a string). + - Issue #7995: When calling accept() on a socket with a timeout, the returned socket is now always blocking, regardless of the operating system.