File tree 2 files changed +14
-1
lines changed 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -280,12 +280,26 @@ def _is_kwlist(decl):
280
280
vartype = '' .join (str (decl .vartype ).split ())
281
281
return vartype == 'char*[]'
282
282
283
+ def _is_local_static_mutex (decl ):
284
+ if not hasattr (decl , "vartype" ):
285
+ return False
286
+
287
+ if not hasattr (decl , "parent" ) or decl .parent is None :
288
+ # We only want to allow local variables
289
+ return False
290
+
291
+ vartype = decl .vartype
292
+ return (vartype .typespec == 'PyMutex' ) and (decl .storage == 'static' )
283
293
284
294
def _has_other_supported_type (decl ):
285
295
if hasattr (decl , 'file' ) and decl .file .filename .endswith ('.c.h' ):
286
296
assert 'clinic' in decl .file .filename , (decl ,)
287
297
if decl .name == '_kwtuple' :
288
298
return True
299
+ if _is_local_static_mutex (decl ):
300
+ # GH-127081: Local static mutexes are used to
301
+ # wrap libc functions that aren't thread safe
302
+ return True
289
303
vartype = str (decl .vartype ).split ()
290
304
if vartype [0 ] == 'struct' :
291
305
vartype = vartype [1 :]
Original file line number Diff line number Diff line change @@ -739,7 +739,6 @@ Modules/expat/xmlrole.c - declClose -
739
739
Modules/expat/xmlrole.c - error -
740
740
741
741
# # other
742
- Modules/grpmodule.c grp_getgrall_impl getgrall_mutex -
743
742
Modules/_io/_iomodule.c - _PyIO_Module -
744
743
Modules/_sqlite/module.c - _sqlite3module -
745
744
Modules/clinic/md5module.c.h _md5_md5 _keywords -
You can’t perform that action at this time.
0 commit comments