https://github.com/python/cpython/commit/0c0348adbfca991f78b3aaa6790e5c26606a1c0f
commit: 0c0348adbfca991f78b3aaa6790e5c26606a1c0f
branch: main
author: Nikita Sobolev <[email protected]>
committer: sobolevn <[email protected]>
date: 2024-06-16T11:26:13+03:00
summary:
gh-120579: Guard `_testcapi` import in `test_free_threading` (#120580)
files:
M Lib/test/test_free_threading/test_dict.py
diff --git a/Lib/test/test_free_threading/test_dict.py
b/Lib/test/test_free_threading/test_dict.py
index f877582e6b565c..3126458e08e50a 100644
--- a/Lib/test/test_free_threading/test_dict.py
+++ b/Lib/test/test_free_threading/test_dict.py
@@ -8,7 +8,10 @@
from threading import Thread
from unittest import TestCase
-from _testcapi import dict_version
+try:
+ import _testcapi
+except ImportError:
+ _testcapi = None
from test.support import threading_helper
@@ -139,7 +142,9 @@ def writer_func(l):
for ref in thread_list:
self.assertIsNone(ref())
+ @unittest.skipIf(_testcapi is None, 'need _testcapi module')
def test_dict_version(self):
+ dict_version = _testcapi.dict_version
THREAD_COUNT = 10
DICT_COUNT = 10000
lists = []
_______________________________________________
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]