Skip to content

Commit

Permalink
[3.12] gh-128833: Patch `test_embed.test_specialized_static_code_gets…
Browse files Browse the repository at this point in the history
…_unspecialized_at_Py_FINALIZE` on Windows (#128860)

Hotfix for `test_embed`
  • Loading branch information
picnixz authored Jan 15, 2025
1 parent febe67b commit 6c9b7e5
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 6c9b7e5

Please sign in to comment.