# HG changeset patch # Parent c64dec45d46f7f5096d7d4ab70f630a390b45995 Issue #15599: OS X prior to 10.5 also cannot handle gil_interval == 1. diff --git a/Lib/test/test_threaded_import.py b/Lib/test/test_threaded_import.py --- a/Lib/test/test_threaded_import.py +++ b/Lib/test/test_threaded_import.py @@ -225,8 +225,22 @@ @reap_threads def test_main(): old_switchinterval = None + new_switchinterval = 0.00000001 # Issue #15599: FreeBSD/KVM cannot handle gil_interval == 1. - new_switchinterval = 0.00001 if 'freebsd' in sys.platform else 0.00000001 + if 'freebsd' in sys.platform: + new_switchinterval = 0.00001 + # also OS X versions prior to 10.5. + elif sys.platform == 'darwin': + import platform + version_txt = platform.mac_ver()[0] + try: + version = tuple(map(int, version_txt.split('.'))) + except ValueError: + pass + else: + if version < (10, 5): + new_switchinterval = 0.00001 + try: old_switchinterval = sys.getswitchinterval() sys.setswitchinterval(new_switchinterval)