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 27ce45d8e1)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2022-10-07 22:02:45 -07:00 committed by GitHub
parent 8d40fbe48b
commit 225bee75e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -707,7 +707,7 @@ def get_disassembly(self, func, lasti=-1, wrapper=True, **kwargs):
return output.getvalue() return output.getvalue()
if sys.flags.optimize: if dis.code_info.__doc__ is None:
code_info_consts = "0: None" code_info_consts = "0: None"
else: else:
code_info_consts = "0: 'Formatted details of methods, functions, or code.'" code_info_consts = "0: 'Formatted details of methods, functions, or code.'"