From: Mikhail Efimov Date: Tue, 19 Aug 2025 08:48:35 +0000 (+0300) Subject: gh-136438: Make sure `test_dis` pass with all optimization levels (GH-136593) X-Git-Tag: v3.15.0a1~646 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=06dd63501af6043542399b6ec9fc9baecf4b4444;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index fb47345857f1..3e7477487200 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -830,7 +830,7 @@ Disassembly of : %4d LOAD_GLOBAL 1 (list + NULL) LOAD_FAST_BORROW 0 (x) BUILD_TUPLE 1 - LOAD_CONST 1 ( at 0x..., file "%s", line %d>) + LOAD_CONST %d ( at 0x..., file "%s", line %d>) MAKE_FUNCTION SET_FUNCTION_ATTRIBUTE 8 (closure) LOAD_DEREF 1 (y) @@ -842,6 +842,7 @@ Disassembly of : _h.__code__.co_firstlineno + 1, _h.__code__.co_firstlineno + 1, _h.__code__.co_firstlineno + 3, + 1 if __debug__ else 0, __file__, _h.__code__.co_firstlineno + 3, ) @@ -1468,7 +1469,7 @@ Positional-only arguments: 0 Kw-only arguments: 0 Number of locals: 1 Stack size: \\d+ -Flags: OPTIMIZED, NEWLOCALS, HAS_DOCSTRING +Flags: OPTIMIZED, NEWLOCALS(, HAS_DOCSTRING)? Constants: {code_info_consts} Names: