8000 gh-92886: make test_ast pass with -O (assertions off) (GH-98058) · miss-islington/cpython@f04d74e · GitHub
[go: up one dir, main page]

Skip to content

Commit f04d74e

Browse files
iritkatrielmiss-islington
authored andcommitted
pythongh-92886: make test_ast pass with -O (assertions off) (pythonGH-98058)
-O does not strip docstrings. Automerge-Triggered-By: GH:iritkatriel (cherry picked from commit 27ce45d) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
1 parent 17c9ce1 commit f04d74e

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)
0