@@ -5380,8 +5380,8 @@ def test_errno_module_has_signatures(self):
53805380 def test_faulthandler_module_has_signatures (self ):
53815381 import faulthandler
53825382 unsupported_signature = {'dump_traceback' , 'dump_traceback_later' , 'enable' }
5383- if os . name == 'posix' :
5384- unsupported_signature |= { 'register' }
5383+ unsupported_signature |= { name for name in [ 'register' ]
5384+ if hasattr ( faulthandler , name ) }
53855385 self ._test_module_has_signatures (faulthandler , unsupported_signature = unsupported_signature )
53865386
53875387 def test_functools_module_has_signatures (self ):
@@ -5419,10 +5419,10 @@ def test_operator_module_has_signatures(self):
54195419
54205420 def test_os_module_has_signatures (self ):
54215421 unsupported_signature = {'chmod' , 'get_terminal_size' , 'utime' }
5422- if os . name == 'posix' :
5423- unsupported_signature |= { 'posix_spawn ' , 'posix_spawnp ' , 'register_at_fork' }
5424- if os . name == 'nt' :
5425- unsupported_signature |= { 'startfile' }
5422+ unsupported_signature |= { name for name in
5423+ [ 'get_terminal_size ' , 'posix_spawn ' , 'posix_spawnp' ,
5424+ 'register_at_fork' , 'startfile' ]
5425+ if hasattr ( os , name ) }
54265426 self ._test_module_has_signatures (os , unsupported_signature = unsupported_signature )
54275427
54285428 def test_pwd_module_has_signatures (self ):
@@ -5470,11 +5470,10 @@ def test_time_module_has_signatures(self):
54705470 'asctime' , 'ctime' , 'get_clock_info' , 'gmtime' , 'localtime' ,
54715471 'strftime' , 'strptime'
54725472 }
5473- if os .name == 'posix' :
5474- no_signature |= {'clock_getres' , 'clock_settime' , 'clock_settime_ns' }
5475- for name in ['pthread_getcpuclockid' ]:
5476- if hasattr (time , name ):
5477- no_signature .add (name )
5473+ no_signature |= {name for name in
5474+ ['clock_getres' , 'clock_settime' , 'clock_settime_ns' ,
5475+ 'pthread_getcpuclockid' ]
5476+ if hasattr (time , name )}
54785477 self ._test_module_has_signatures (time , no_signature )
54795478
54805479 def test_tokenize_module_has_signatures (self ):
0 commit comments