Skip to content

Commit 1408896

Browse files
committed
Skip test when InterpreterPoolExecutor missing
1 parent f1cf169 commit 1408896

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Lib/test/test_struct.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -800,14 +800,13 @@ def test_c_complex_round_trip(self):
800800
round_trip = struct.unpack(f, struct.pack(f, z))[0]
801801
self.assertComplexesAreIdentical(z, round_trip)
802802

803-
@unittest.skipUnless(
804-
support.Py_GIL_DISABLED,
805-
'this test can only possibly fail with GIL disabled'
806-
)
807803
def test_endian_table_init_subinterpreters(self):
808804
# Verify that the _struct extension module can be initialized
809805
# concurrently in subinterpreters (gh-140260).
810-
from concurrent.futures import InterpreterPoolExecutor
806+
try:
807+
from concurrent.futures import InterpreterPoolExecutor
808+
except ImportError:
809+
raise unittest.SkipTest("InterpreterPoolExecutor not available")
811810

812811
code = "import struct"
813812
with InterpreterPoolExecutor(max_workers=5) as executor:

0 commit comments

Comments
 (0)