diff options
author | Georg Brandl <georg@python.org> | 2010-07-30 09:14:20 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-07-30 09:14:20 (GMT) |
commit | 46b9afc862974e5855f0ca8a181096945483c86e (patch) | |
tree | 8ad8005224efaf00ef06fbb4c609b5eb6091d6ad /Lib/bdb.py | |
parent | 44f8bf941109c24d36d7d6e4dd05080a0191f3d9 (diff) | |
download | cpython-46b9afc862974e5855f0ca8a181096945483c86e.zip cpython-46b9afc862974e5855f0ca8a181096945483c86e.tar.gz cpython-46b9afc862974e5855f0ca8a181096945483c86e.tar.bz2 |
#1472251: remove addition of "\n" to code given to pdb.run[eval](), the bug in exec() that made this necessary has been fixed. Also document that you can give code objects to run() and runeval(), and add some tests to test_pdb.
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r-- | Lib/bdb.py | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -364,8 +364,9 @@ class Bdb: if line: s = s + lprefix + line.strip() return s - # The following two methods can be called by clients to use - # a debugger to debug a statement, given as a string. + # The following methods can be called by clients to use + # a debugger to debug a statement or an expression. + # Both can be given as a string, or a code object. def run(self, cmd, globals=None, locals=None): if globals is None: @@ -375,8 +376,6 @@ class Bdb: locals = globals self.reset() sys.settrace(self.trace_dispatch) - if not isinstance(cmd, types.CodeType): - cmd = cmd+'\n' try: exec(cmd, globals, locals) except BdbQuit: @@ -393,8 +392,6 @@ class Bdb: locals = globals self.reset() sys.settrace(self.trace_dispatch) - if not isinstance(expr, types.CodeType): - expr = expr+'\n' try: return eval(expr, globals, locals) except BdbQuit: |