Skip to content

Commit c176543

Browse files
authored
gh-136438: Make sure test_builtins pass with all optimization levels (#136474)
1 parent b44316a commit c176543

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_builtin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def f(): """doc"""
436436
# test both direct compilation and compilation via AST
437437
codeobjs = []
438438
codeobjs.append(compile(codestr, "<test>", "exec", optimize=optval))
439-
tree = ast.parse(codestr)
439+
tree = ast.parse(codestr, optimize=optval)
440440
codeobjs.append(compile(tree, "<test>", "exec", optimize=optval))
441441
for code in codeobjs:
442442
ns = {}
@@ -624,7 +624,7 @@ def test_compile_ast(self):
624624
for opt in [opt1, opt2]:
625625
opt_right = opt.value.right
626626
self.assertIsInstance(opt_right, ast.Constant)
627-
self.assertEqual(opt_right.value, True)
627+
self.assertEqual(opt_right.value, __debug__)
628628

629629
def test_delattr(self):
630630
sys.spam = 1

0 commit comments

Comments
 (0)