Skip to content

Commit 225bee7

Browse files
gh-92886: make test_ast pass with -O (assertions off) (GH-98058)
-O does not strip docstrings. Automerge-Triggered-By: GH:iritkatriel (cherry picked from commit 27ce45d) Co-authored-by: Irit Katriel <[email protected]>
1 parent 8d40fbe commit 225bee7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_dis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs):
707707
return output.getvalue()
708708

709709

710-
if sys.flags.optimize:
710+
if dis.code_info.__doc__ is None:
711711
code_info_consts = "0: None"
712712
else:
713713
code_info_consts = "0: 'Formatted details of methods, functions, or code.'"

0 commit comments

Comments
 (0)