Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cpython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sip
Cpython
Commits
84b986ba
Unverified
Commit
84b986ba
authored
May 2, 2022
by
Irit Katriel
Committed by
GitHub
May 2, 2022
Browse files
Options
Downloads
Patches
Plain Diff
gh-91276: revert the increase of dis output width (GH-92126)
parent
b9ab6cea
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Lib/dis.py
+1
-1
1 addition, 1 deletion
Lib/dis.py
Lib/test/test_dis.py
+265
-253
265 additions, 253 deletions
Lib/test/test_dis.py
with
266 additions
and
254 deletions
Lib/dis.py
+
1
−
1
View file @
84b986ba
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Lib/test/test_dis.py
+
265
−
253
View file @
84b986ba
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment