summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_embed.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_embed.py')
-rw-r--r--Lib/test/test_embed.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py
index 7222137..cd65496 100644
--- a/Lib/test/test_embed.py
+++ b/Lib/test/test_embed.py
@@ -391,6 +391,7 @@ class EmbeddingTests(EmbeddingTestsMixin, unittest.TestCase):
import importlib._bootstrap
import opcode
import test.test_dis
+ import test.support
def is_specialized(f):
for instruction in dis.get_instructions(f, adaptive=True):
@@ -409,7 +410,7 @@ class EmbeddingTests(EmbeddingTestsMixin, unittest.TestCase):
func = importlib._bootstrap._handle_fromlist
# "copy" the code to un-specialize it:
- func.__code__ = func.__code__.replace()
+ test.support.reset_code(func)
assert not is_specialized(func), "specialized instructions found"