Skip to content

Commit e493792

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 72a23d8 commit e493792

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_dis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs):
10761076
return output.getvalue()
10771077

10781078

1079-
if sys.flags.optimize:
1079+
if dis.code_info.__doc__ is None:
10801080
code_info_consts = "0: None"
10811081
else:
10821082
code_info_consts = "0: 'Formatted details of methods, functions, or code.'"

0 commit comments

Comments
 (0)