mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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
This commit is contained in:
parent
db68544122
commit
f24b8101a0
3 changed files with 20 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue