diff options
author | Yurii Karabas <1998uriyyo@gmail.com> | 2020-12-04 17:20:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-04 15:20:53 +0000 |
commit | f24b8101a01fa98b1e3ec042ba896aeb4c24d4bc (patch) | |
tree | 0609fe4244b29ddceb20c1d0dbb23fb2e43a377c /Lib/dis.py | |
parent | db68544122f5a0c7b80f69c0e643049efa6699c6 (diff) | |
download | cpython-git-f24b8101a01fa98b1e3ec042ba896aeb4c24d4bc.tar.gz |
bpo-42562: Fix issue when dis failed to parse function that has no line numbers (GH-23632)
Fix issue when dis failed to parse function that has only annotations
Diffstat (limited to 'Lib/dis.py')
-rw-r--r-- | Lib/dis.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/dis.py b/Lib/dis.py index ea50f564c8..ccbd65be73 100644 --- a/Lib/dis.py +++ b/Lib/dis.py @@ -384,7 +384,7 @@ def _disassemble_bytes(code, lasti=-1, varnames=None, names=None, constants=None, cells=None, linestarts=None, *, file=None, line_offset=0): # Omit the line number column entirely if we have no line number info - show_lineno = linestarts is not None + show_lineno = bool(linestarts) if show_lineno: maxlineno = max(linestarts.values()) + line_offset if maxlineno >= 1000: |