@@ -462,11 +462,11 @@ def skip_if_buildbot(reason=None):
462462 return unittest .skipIf (isbuildbot , reason )
463463
464464def check_sanitizer (* , address = False , hwaddress = False , memory = False , ub = False ,
465- thread = False , function = True ):
465+ thread = False , function = False ):
466466 """Returns True if Python is compiled with sanitizer support"""
467- if not (address or hwaddress or memory or ub or thread ):
468- raise ValueError ('At least one of address, hwaddress, memory, ub or '
469- 'thread must be True' )
467+ if not (address or hwaddress or memory or ub or thread or function ):
468+ raise ValueError ('At least one of address, hwaddress, memory, ub, '
469+ 'thread or function must be True' )
470470
471471
472472 cflags = sysconfig .get_config_var ('CFLAGS' ) or ''
@@ -517,11 +517,13 @@ def configured_with_sanitizer(name):
517517 )
518518
519519
520- def skip_if_sanitizer (reason = None , * , address = False , memory = False , ub = False , thread = False ):
520+ def skip_if_sanitizer (reason = None , * , address = False , memory = False , ub = False ,
521+ thread = False , function = False ):
521522 """Decorator raising SkipTest if running with a sanitizer active."""
522523 if not reason :
523524 reason = 'not working with sanitizers active'
524- skip = check_sanitizer (address = address , memory = memory , ub = ub , thread = thread )
525+ skip = check_sanitizer (address = address , memory = memory , ub = ub ,
526+ thread = thread , function = function )
525527 return unittest .skipIf (skip , reason )
526528
527529# gh-89363: True if fork() can hang if Python is built with Address Sanitizer
0 commit comments