gh-130080: fix warnings in tests (#131400)

This commit is contained in:
Irit Katriel 2025-03-18 12:33:46 +00:00 committed by GitHub
parent 51d309988b
commit 83479c2175
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 82 additions and 77 deletions

View file

@ -2415,7 +2415,9 @@ class TestStackSizeStability(unittest.TestCase):
script = """def func():\n""" + i * snippet
if async_:
script = "async " + script
code = compile(script, "<script>", "exec")
with warnings.catch_warnings():
warnings.simplefilter('ignore', SyntaxWarning)
code = compile(script, "<script>", "exec")
exec(code, ns, ns)
return ns['func'].__code__