summaryrefslogtreecommitdiffstats
path: root/Lib/dis.py
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2022-01-24 11:09:20 (GMT)
committerGitHub <noreply@github.com>2022-01-24 11:09:20 (GMT)
commit58f3d980989c7346ad792d464c1d749dcec6af63 (patch)
tree42ce19f131f418d9423c3eb26c2a7b91f4c223f2 /Lib/dis.py
parent0367a36fdc36b9c909c4d5acf7cde6ceeec0ba69 (diff)
downloadcpython-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.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/dis.py b/Lib/dis.py
index ac0c6e7..2462a84 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.