[Python-checkins] r42231 - sandbox/trunk/setuptools/pkg_resources.py

phillip.eby python-checkins at python.org
Sat Feb 4 01:03:26 CET 2006


Author: phillip.eby
Date: Sat Feb  4 01:03:25 2006
New Revision: 42231

Modified:
   sandbox/trunk/setuptools/pkg_resources.py
Log:
Honor get_platform() for Mac OS X if it starts with 'macosx-'


Modified: sandbox/trunk/setuptools/pkg_resources.py
==============================================================================
--- sandbox/trunk/setuptools/pkg_resources.py	(original)
+++ sandbox/trunk/setuptools/pkg_resources.py	Sat Feb  4 01:03:25 2006
@@ -142,7 +142,9 @@
     XXX Currently this is the same as ``distutils.util.get_platform()``, but it
     needs some hacks for Linux and Mac OS X.
     """
-    if sys.platform == "darwin":
+    from distutils.util import get_platform
+    plat = get_platform()
+    if sys.platform == "darwin" and not plat.startswith('macosx-'):
         try:
             version = _macosx_vers()
             machine = os.uname()[4].replace(" ", "_")
@@ -152,9 +154,7 @@
             # if someone is running a non-Mac darwin system, this will fall
             # through to the default implementation
             pass
-
-    from distutils.util import get_platform
-    return get_platform()
+    return plat
 
 macosVersionString = re.compile(r"macosx-(\d+)\.(\d+)-(.*)")
 darwinVersionString = re.compile(r"darwin-(\d+)\.(\d+)\.(\d+)-(.*)")


More information about the Python-checkins mailing list