Skip to content

Commit 019ed40

Browse files
committed
Revert "pythongh-101517: make bdb avoid looking up in linecache with lineno=None (python#101787)"
This reverts commit 366b949.
1 parent e1e9bab commit 019ed40

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

Lib/bdb.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,9 @@ def format_stack_entry(self, frame_lineno, lprefix=': '):
570570
rv = frame.f_locals['__return__']
571571
s += '->'
572572
s += reprlib.repr(rv)
573-
if lineno is not None:
574-
line = linecache.getline(filename, lineno, frame.f_globals)
575-
if line:
576-
s += lprefix + line.strip()
573+
line = linecache.getline(filename, lineno, frame.f_globals)
574+
if line:
575+
s += lprefix + line.strip()
577576
return s
578577

579578
# The following methods can be called by clients to use

Lib/test/test_bdb.py

-6
Original file line numberDiff line numberDiff line change
@@ -1203,11 +1203,5 @@ def main():
12031203
tracer.runcall(tfunc_import)
12041204

12051205

1206-
class TestRegressions(unittest.TestCase):
1207-
def test_format_stack_entry_no_lineno(self):
1208-
# See gh-101517
1209-
Bdb().format_stack_entry((sys._getframe(), None))
1210-
1211-
12121206
if __name__ == "__main__":
12131207
unittest.main()

0 commit comments

Comments
 (0)