From 58f3d980989c7346ad792d464c1d749dcec6af63 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 24 Jan 2022 14:09:20 +0300 Subject: bpo-46422: use `dis.Positions` in `dis.Instruction` (GH-30716) Co-authored-by: Batuhan Taskaya --- Lib/dis.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Lib/dis.py') diff --git a/Lib/dis.py b/Lib/dis.py index ac0c6e7f04c..2462a8434e8 100644 --- a/Lib/dis.py +++ b/Lib/dis.py @@ -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. -- cgit v1.2.3