Skip to content

Commit

Permalink
gh-120579: Guard _testcapi import in test_free_threading (#120580)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored and pull[bot] committed Jul 23, 2024
1 parent 15badda commit 1407524
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Lib/test/test_free_threading/test_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = []
Expand Down

0 comments on commit 1407524

Please sign in to comment.