From: Benjamin Peterson Date: Wed, 21 May 2008 22:52:39 +0000 (+0000) Subject: check for toolbox glue before testing platform.mac_ver intensly X-Git-Tag: v2.6b1~299 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a4e4ef1cea957795b45e9956a6fc6eec76ceebaf;p=thirdparty%2FPython%2Fcpython.git check for toolbox glue before testing platform.mac_ver intensly --- diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 6275a6a7a30a..a19556db194e 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')