bpo-46422: use dis.Positions in dis.Instruction (GH-30716)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
This commit is contained in:
Nikita Sobolev 2022-01-24 14:09:20 +03:00 committed by GitHub
parent 0367a36fdc
commit 58f3d98098
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 14 deletions

View file

@ -413,10 +413,7 @@ def _get_instructions_bytes(code, varname_from_oparg=None,
is_jump_target = offset in labels
argval = None
argrepr = ''
try:
positions = next(co_positions)
except StopIteration:
positions = None
positions = Positions(*next(co_positions, ()))
if arg is not None:
# Set argval to the dereferenced value of the argument when
# available, and argrepr to the string representation of argval.