]> granicus.if.org Git - python/commitdiff
Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'
authorNed Deily <nad@acm.org>
Wed, 13 Jul 2011 22:05:31 +0000 (15:05 -0700)
committerNed Deily <nad@acm.org>
Wed, 13 Jul 2011 22:05:31 +0000 (15:05 -0700)
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.

Doc/library/platform.rst
Lib/platform.py
Lib/test/test_platform.py
Misc/NEWS

index c2b85e6096d00026e3a649a2e884baff79ac35a5..069993c36922447241a2e9d7920e460017e3f41e 100644 (file)
@@ -233,9 +233,6 @@ Mac OS Platform
    Entries which cannot be determined are set to ``''``.  All tuple entries are
    strings.
 
-   Documentation for the underlying :cfunc:`gestalt` API is available online at
-   http://www.rgaros.nl/gestalt/.
-
 
 Unix Platforms
 --------------
index 6db7f19e48ca6ea9e0aa483dccd1790fe369281f..710f21e706c0134e287d2cf0f5fda2274d0aba28 100755 (executable)
@@ -765,6 +765,7 @@ def _mac_ver_gestalt():
                    0x2: 'PowerPC',
                    0xa: 'i386'}.get(sysa,'')
 
+    versioninfo=('', '', '')
     return release,versioninfo,machine
 
 def _mac_ver_xml():
index 1ae5888250df83bab8e88b2cb8dc14000cf43ae2..941d428c19e266db8355025b4f6276a34e8426b5 100644 (file)
@@ -191,7 +191,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')
 
index b282c13aa635faecc7b553fae1471d93883b5e34..7271ef901edb978621d794fc6c550d1d14088e70 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -101,6 +101,9 @@ Build
 Tests
 -----
 
+- Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'
+  as the processor type on some Mac systems.
+
 - Skip network tests when getaddrinfo() returns EAI_AGAIN, meaning a temporary
   failure in name resolution.