From a8a0636e26875ed72c07178c5b5fbc89f4fb08d3 Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Fri, 7 Oct 2022 21:43:01 +0100 Subject: [PATCH] gh-92886: make test_ast pass with -O (assertions off) --- Lib/test/test_dis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index fc2862c61baadb..667b267d27a06a 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -1212,7 +1212,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.'"