(original) (raw)

changeset: 74482:2ec4ab2a6f65 branch: 2.7 parent: 74479:284550d0d8ae user: Jesus Cea jcea@jcea.es date: Wed Jan 18 04:25:28 2012 +0100 files: Lib/distutils/util.py description: Emergency fix for #13803 bootstrap issue: Under Solaris, distutils doesn't include bitness in the directory name diff -r 284550d0d8ae -r 2ec4ab2a6f65 Lib/distutils/util.py --- a/Lib/distutils/util.py Wed Jan 18 03:51:38 2012 +0100 +++ b/Lib/distutils/util.py Wed Jan 18 04:25:28 2012 +0100 @@ -6,7 +6,7 @@ __revision__ = "$Id$" -import sys, os, string, re, platform +import sys, os, string, re from distutils.errors import DistutilsPlatformError from distutils.dep_util import newer from distutils.spawn import spawn @@ -76,7 +76,11 @@ if release[0] >= "5": # SunOS 5 == Solaris 2 osname = "solaris" release = "%d.%s" % (int(release[0]) - 3, release[2:]) - machine += ".%s" % platform.architecture()[0] + # We can't use "platform.architecture()[0]" because a + # bootstrap problem. We use a dict to get an error + # if some suspicious happens. + bitness = {2147483647:"32bit", 9223372036854775807:"64bit"} + machine += ".%s" % bitness[sys.maxint] # fall through to standard osname-release-machine representation elif osname[:4] == "irix": # could be "irix64"! return "%s-%s" % (osname, release) /jcea@jcea.es