Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions Lib/test/test_dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,11 +1041,6 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs):
return output.getvalue()


if sys.flags.optimize:
code_info_consts = "0: None"
else:
code_info_consts = "0: 'Formatted details of methods, functions, or code.'"

code_info_code_info = f"""\
Name: code_info
Filename: (.*)
Expand All @@ -1056,7 +1051,7 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs):
Stack size: \\d+
Flags: OPTIMIZED, NEWLOCALS
Constants:
{code_info_consts}
0: 'Formatted details of methods, functions, or code.'
Names:
0: _format_code_info
1: _get_code_object
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixing tests that fail when running with optimizations (``-O``) in ``test_dis.py``.