]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
check for toolbox glue before testing platform.mac_ver intensly
authorBenjamin Peterson <benjamin@python.org>
Wed, 21 May 2008 22:52:39 +0000 (22:52 +0000)
committerBenjamin Peterson <benjamin@python.org>
Wed, 21 May 2008 22:52:39 +0000 (22:52 +0000)
Lib/test/test_platform.py

index 6275a6a7a30ae7174a81797f5ee9b61073c8c14e..a19556db194e530fbd5f94d13559f7feccbc0742 100644 (file)
@@ -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')