summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/bdb.py2
1 files changed, 2 insertions, 0 deletions
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 @@ 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)