Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.12] gh-128833: Patch test_embed.test_specialized_static_code_gets_unspecialized_at_Py_FINALIZE on Windows #128860

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Lib/test/test_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ def test_simple_initialization_api(self):
@support.requires_specialization
def test_specialized_static_code_gets_unspecialized_at_Py_FINALIZE(self):
# https://github.com/python/cpython/issues/92031
from test.test_dis import ADAPTIVE_WARMUP_DELAY

code = textwrap.dedent("""\
code = textwrap.dedent(f"""\
import dis
import importlib._bootstrap
import opcode
import test.test_dis

def is_specialized(f):
for instruction in dis.get_instructions(f, adaptive=True):
Expand All @@ -373,7 +373,7 @@ def is_specialized(f):

assert not is_specialized(func), "specialized instructions found"

for i in range(test.test_dis.ADAPTIVE_WARMUP_DELAY):
for i in range({ADAPTIVE_WARMUP_DELAY}):
func(importlib._bootstrap, ["x"], lambda *args: None)

assert is_specialized(func), "no specialized instructions found"
Expand Down
Loading