diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 6275a6a7a30..a19556db194 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -65,7 +65,14 @@ class PlatformTest(unittest.TestCase): def test_mac_ver(self): res = platform.mac_ver() - if os.uname()[0] == 'Darwin': + try: + import gestalt + except ImportError: + have_toolbox_glue = False + else: + have_toolbox_glue = True + + if have_toolbox_glue and os.uname()[0] == 'Darwin': # We're on a MacOSX system, check that # the right version information is returned fd = os.popen('sw_vers', 'r')