Skip to content

Commit

Permalink
gh-92886: make test_ast pass with -O (assertions off) (GH-98058)
Browse files Browse the repository at this point in the history
-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>
  • Loading branch information
miss-islington and iritkatriel authored Oct 8, 2022
1 parent 8d40fbe commit 225bee7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs):
return output.getvalue()


if sys.flags.optimize:
if dis.code_info.__doc__ is None:
code_info_consts = "0: None"
else:
code_info_consts = "0: 'Formatted details of methods, functions, or code.'"
Expand Down

0 comments on commit 225bee7

Please sign in to comment.