summaryrefslogtreecommitdiffstats
path: root/Lib/bdb.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-07-30 08:43:32 (GMT)
committerGeorg Brandl <georg@python.org>2010-07-30 08:43:32 (GMT)
commit2dfec552fe6a8884e0dd37be382e2454d701f5d9 (patch)
treeb0c1a83475467ca9f49d2a0e3ddb11a733d6a64f /Lib/bdb.py
parente023091815e4946e42c1af102be1f258b2f47cb8 (diff)
downloadcpython-2dfec552fe6a8884e0dd37be382e2454d701f5d9.zip
cpython-2dfec552fe6a8884e0dd37be382e2454d701f5d9.tar.gz
cpython-2dfec552fe6a8884e0dd37be382e2454d701f5d9.tar.bz2
Allow giving an explicit line number to "until".
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r--Lib/bdb.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/bdb.py b/Lib/bdb.py
index 3b4f991..cee71a4 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -174,10 +174,13 @@ class Bdb:
# Derived classes and clients can call the following methods
# to affect the stepping state.
- def set_until(self, frame): #the name "until" is borrowed from gdb
+ def set_until(self, frame, lineno=None):
"""Stop when the line with the line no greater than the current one is
reached or when returning from current frame"""
- self._set_stopinfo(frame, frame, frame.f_lineno+1)
+ # the name "until" is borrowed from gdb
+ if lineno is None:
+ lineno = frame.f_lineno + 1
+ self._set_stopinfo(frame, frame, lineno)
def set_step(self):
"""Stop after one line of code."""