From: Ned Deily Date: Wed, 13 Jul 2011 22:07:04 +0000 (-0700) Subject: Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64' X-Git-Tag: v3.2.2rc1~117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58e3350bd48d59c273e320c408f2546e6d09146e;p=python Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64' as the processor type on some Mac systems. Also fix NameError in fallback _mac_ver_gestalt function. And remove out-of-date URL in docs. --- diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst index d8e516633e..929936e781 100644 --- a/Doc/library/platform.rst +++ b/Doc/library/platform.rst @@ -228,9 +228,6 @@ Mac OS Platform Entries which cannot be determined are set to ``''``. All tuple entries are strings. - Documentation for the underlying :c:func:`gestalt` API is available online at - http://www.rgaros.nl/gestalt/. - Unix Platforms -------------- diff --git a/Lib/platform.py b/Lib/platform.py index 967491a827..6e301da0e1 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -758,6 +758,7 @@ def _mac_ver_gestalt(): 0x2: 'PowerPC', 0xa: 'i386'}.get(sysa,'') + versioninfo=('', '', '') return release,versioninfo,machine def _mac_ver_xml(): diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index ec134a17e0..8751aa86ba 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -194,7 +194,7 @@ class PlatformTest(unittest.TestCase): self.assertEqual(res[1], ('', '', '')) if sys.byteorder == 'little': - self.assertEqual(res[2], 'i386') + self.assertIn(res[2], ('i386', 'x86_64')) else: self.assertEqual(res[2], 'PowerPC') diff --git a/Misc/NEWS b/Misc/NEWS index caa12a61d1..6bb9f9f1c1 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -56,6 +56,9 @@ C-API Tests ----- +- Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64' + as the processor type on some Mac systems. + - Avoid failing in test_robotparser when mueblesmoraleda.com is flaky and an overzealous DNS service (e.g. OpenDNS) redirects to a placeholder Web site.