55 create_string_buffer , create_unicode_buffer ,
66 c_char , c_wchar , c_byte , c_ubyte , c_short , c_ushort , c_int , c_uint ,
77 c_long , c_ulonglong , c_float , c_double , c_longdouble )
8- from test .support import bigmemtest , _2G , threading_helper
8+ from test .support import bigmemtest , _2G , threading_helper , Py_GIL_DISABLED
99from ._support import (_CData , PyCArrayType , Py_TPFLAGS_DISALLOW_INSTANTIATION ,
1010 Py_TPFLAGS_IMMUTABLETYPE )
1111
@@ -268,7 +268,7 @@ def test_large_array(self, size):
268268 c_char * size
269269
270270 @threading_helper .requires_working_threading ()
271- @unittest .skipUnless (support . Py_GIL_DISABLED , "only meaningful if the GIL is disabled" )
271+ @unittest .skipUnless (Py_GIL_DISABLED , "only meaningful if the GIL is disabled" )
272272 def test_thread_safety (self ):
273273 from threading import Thread
274274
@@ -280,7 +280,7 @@ def run():
280280 buffer [0 ] = b"j"
281281
282282 with threading_helper .catch_threading_exception () as cm :
283- with threading_helper .start_threads ((run for _ in range (25 ))):
283+ with threading_helper .start_threads ((Thread ( target = run ) for _ in range (25 ))):
284284 pass
285285
286286 self .assertIsNone (cm .exc_value )
0 commit comments