Skip to content

Commit 06dd635

Browse files
gh-136438: Make sure test_dis pass with all optimization levels (GH-136593)
Now tests pass with all combinations of -OO and --without-doc-strings.
1 parent 9cb9130 commit 06dd635

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/test/test_dis.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ def foo(x):
830830
%4d LOAD_GLOBAL 1 (list + NULL)
831831
LOAD_FAST_BORROW 0 (x)
832832
BUILD_TUPLE 1
833-
LOAD_CONST 1 (<code object <genexpr> at 0x..., file "%s", line %d>)
833+
LOAD_CONST %d (<code object <genexpr> at 0x..., file "%s", line %d>)
834834
MAKE_FUNCTION
835835
SET_FUNCTION_ATTRIBUTE 8 (closure)
836836
LOAD_DEREF 1 (y)
@@ -842,6 +842,7 @@ def foo(x):
842842
_h.__code__.co_firstlineno + 1,
843843
_h.__code__.co_firstlineno + 1,
844844
_h.__code__.co_firstlineno + 3,
845+
1 if __debug__ else 0,
845846
__file__,
846847
_h.__code__.co_firstlineno + 3,
847848
)
@@ -1468,7 +1469,7 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs):
14681469
Kw-only arguments: 0
14691470
Number of locals: 1
14701471
Stack size: \\d+
1471-
Flags: OPTIMIZED, NEWLOCALS, HAS_DOCSTRING
1472+
Flags: OPTIMIZED, NEWLOCALS(, HAS_DOCSTRING)?
14721473
Constants:
14731474
{code_info_consts}
14741475
Names:

0 commit comments

Comments
 (0)