https://github.com/python/cpython/commit/6c9b7e591b8d19fce53f8ad0e5d617a1c1842319
commit: 6c9b7e591b8d19fce53f8ad0e5d617a1c1842319
branch: 3.12
author: Bénédikt Tran <[email protected]>
committer: ambv <[email protected]>
date: 2025-01-15T14:22:45+01:00
summary:
[3.12] gh-128833: Patch
`test_embed.test_specialized_static_code_gets_unspecialized_at_Py_FINALIZE` on
Windows (#128860)
Hotfix for `test_embed`
files:
M Lib/test/test_embed.py
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py
index 13713cf37b83a4..c931d160350545 100644
--- a/Lib/test/test_embed.py
+++ b/Lib/test/test_embed.py
@@ -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):
@@ -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"
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]