Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add warning to s
  • Loading branch information
iritkatriel committed Apr 14, 2023
commit 073c8608c61fb85914833f10da7f285c4904bec3
2 changes: 1 addition & 1 deletion Lib/bdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def format_stack_entry(self, frame_lineno, lprefix=': '):
if line:
s += lprefix + line.strip()
else:
print('bdb.Bdb.format_stack_entry: lineno is None')
s += '\nWarning: lineno is None'
Comment thread
iritkatriel marked this conversation as resolved.
Outdated
return s

# The following methods can be called by clients to use
Expand Down
3 changes: 2 additions & 1 deletion Lib/test/test_bdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,8 @@ def main():
class TestRegressions(unittest.TestCase):
def test_format_stack_entry_no_lineno(self):
# See gh-101517
Bdb().format_stack_entry((sys._getframe(), None))
self.assertIn('Warning: lineno is None',
Bdb().format_stack_entry((sys._getframe(), None)))


if __name__ == "__main__":
Expand Down