File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -800,16 +800,19 @@ 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 (support .Py_GIL_DISABLED , 'this test can only possibly fail with GIL disabled' )
803804 def test_endian_table_init_subinterpreters (self ):
804805 # Verify that the _struct extension module can be initialized
805806 # concurrently in subinterpreters (gh-140260).
806807 from concurrent .futures import InterpreterPoolExecutor
807808
809+ def _exec_code (code_str ):
810+ exec (code_str )
811+
808812 code = "import struct"
809813 with InterpreterPoolExecutor (max_workers = 5 ) as executor :
810- results = executor .map (support .run_in_subinterp , [code ] * 5 )
811- for ret in results :
812- self .assertEqual (ret , 0 )
814+ results = executor .map (_exec_code , [code ] * 5 )
815+ self .assertListEqual (list (results ), [None ] * 5 )
813816
814817
815818class UnpackIteratorTest (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments