gh-112137: change dis output to show no-lineno as -- instead of None (#112335)

This commit is contained in:
Irit Katriel 2023-11-23 14:34:27 +00:00 committed by GitHub
parent 9e56eedd01
commit 89ddea4886
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 16 deletions

View file

@ -478,7 +478,8 @@ class Instruction(_Instruction):
if self.starts_line:
lineno_fmt = "%%%dd" if self.line_number is not None else "%%%ds"
lineno_fmt = lineno_fmt % lineno_width
fields.append(lineno_fmt % self.line_number)
lineno = self.line_number if self.line_number is not None else '--'
fields.append(lineno_fmt % lineno)
else:
fields.append(' ' * lineno_width)
# Column: Label