diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-01-24 11:09:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-24 11:09:20 (GMT) |
commit | 58f3d980989c7346ad792d464c1d749dcec6af63 (patch) | |
tree | 42ce19f131f418d9423c3eb26c2a7b91f4c223f2 /Lib/dis.py | |
parent | 0367a36fdc36b9c909c4d5acf7cde6ceeec0ba69 (diff) | |
download | cpython-58f3d980989c7346ad792d464c1d749dcec6af63.zip cpython-58f3d980989c7346ad792d464c1d749dcec6af63.tar.gz cpython-58f3d980989c7346ad792d464c1d749dcec6af63.tar.bz2 |
bpo-46422: use `dis.Positions` in `dis.Instruction` (GH-30716)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
Diffstat (limited to 'Lib/dis.py')
-rw-r--r-- | Lib/dis.py | 5 |
1 files changed, 1 insertions, 4 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. |