mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
bpo-46422: use dis.Positions
in dis.Instruction
(GH-30716)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
This commit is contained in:
parent
0367a36fdc
commit
58f3d98098
4 changed files with 42 additions and 14 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue