diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-02-10 17:24:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-10 17:24:30 (GMT) |
commit | 6d8ef9680689823229106c22aa74e1c549a250ec (patch) | |
tree | b4d30f74bfd64ccbd119e32184d62cf24b434b00 /Lib/bdb.py | |
parent | b653fced316c14eec669ee94e57240fffdfaf1f4 (diff) | |
download | cpython-6d8ef9680689823229106c22aa74e1c549a250ec.zip cpython-6d8ef9680689823229106c22aa74e1c549a250ec.tar.gz cpython-6d8ef9680689823229106c22aa74e1c549a250ec.tar.bz2 |
gh-101517: make bdb avoid looking up in linecache with lineno=None (GH-101787)
(cherry picked from commit 366b94905869d680b3f1d4801fb497e78811e511)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r-- | Lib/bdb.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -570,9 +570,10 @@ class Bdb: rv = frame.f_locals['__return__'] s += '->' s += reprlib.repr(rv) - line = linecache.getline(filename, lineno, frame.f_globals) - if line: - s += lprefix + line.strip() + if lineno is not None: + line = linecache.getline(filename, lineno, frame.f_globals) + if line: + s += lprefix + line.strip() return s # The following methods can be called by clients to use |