[Python-checkins] cpython (2.7): Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'

ned.deily python-checkins at python.org
Thu Jul 14 00:10:36 CEST 2011


http://hg.python.org/cpython/rev/0a53a978a160
changeset:   71316:0a53a978a160
branch:      2.7
parent:      71313:a9d0fab19d5e
user:        Ned Deily <nad at acm.org>
date:        Wed Jul 13 15:05:31 2011 -0700
summary:
  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.

files:
  Doc/library/platform.rst  |  3 ---
  Lib/platform.py           |  1 +
  Lib/test/test_platform.py |  2 +-
  Misc/NEWS                 |  3 +++
  4 files changed, 5 insertions(+), 4 deletions(-)


diff --git a/Doc/library/platform.rst b/Doc/library/platform.rst
--- a/Doc/library/platform.rst
+++ b/Doc/library/platform.rst
@@ -233,9 +233,6 @@
    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
 --------------
diff --git a/Lib/platform.py b/Lib/platform.py
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -765,6 +765,7 @@
                    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
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -191,7 +191,7 @@
             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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -101,6 +101,9 @@
 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.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list