Skip to content
Snippets Groups Projects
Unverified Commit 84b986ba authored by Irit Katriel's avatar Irit Katriel Committed by GitHub
Browse files

gh-91276: revert the increase of dis output width (GH-92126)

parent b9ab6cea
Branches
Tags
No related merge requests found
......@@ -264,7 +264,7 @@ def show_code(co, *, file=None):
_ExceptionTableEntry = collections.namedtuple("_ExceptionTableEntry",
"start end target depth lasti")
_OPNAME_WIDTH = max(map(len, opmap))
_OPNAME_WIDTH = 20
_OPARG_WIDTH = 5
class Instruction(_Instruction):
......
......@@ -734,7 +734,19 @@ def test_boundaries(self):
self.assertEqual(dis.opmap["STORE_NAME"], dis.HAVE_ARGUMENT)
def test_widths(self):
long_opcodes = set(['POP_JUMP_FORWARD_IF_FALSE',
'POP_JUMP_FORWARD_IF_TRUE',
'POP_JUMP_FORWARD_IF_NOT_NONE',
'POP_JUMP_FORWARD_IF_NONE',
'POP_JUMP_BACKWARD_IF_FALSE',
'POP_JUMP_BACKWARD_IF_TRUE',
'POP_JUMP_BACKWARD_IF_NOT_NONE',
'POP_JUMP_BACKWARD_IF_NONE',
'JUMP_BACKWARD_NO_INTERRUPT',
])
for opcode, opname in enumerate(dis.opname):
if opname in long_opcodes:
continue
with self.subTest(opname=opname):
width = dis._OPNAME_WIDTH
if opcode < dis.HAVE_ARGUMENT:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment