[Numpy-svn] r6309 - trunk/numpy/distutils

numpy-svn@scip... numpy-svn@scip...
Fri Jan 9 02:59:29 CST 2009


Author: jarrod.millman
Date: 2009-01-09 02:59:29 -0600 (Fri, 09 Jan 2009)
New Revision: 6309

Modified:
   trunk/numpy/distutils/system_info.py
Log:
should be more reliable way to determine what bit platform


Modified: trunk/numpy/distutils/system_info.py
===================================================================
--- trunk/numpy/distutils/system_info.py	2009-01-09 05:26:58 UTC (rev 6308)
+++ trunk/numpy/distutils/system_info.py	2009-01-09 08:59:29 UTC (rev 6309)
@@ -128,6 +128,11 @@
 from numpy.distutils.misc_util import is_sequence, is_string
 from numpy.distutils.command.config import config as cmd_config
 
+# Determine number of bits
+import platform
+_bits = {'32bit':32,'64bit':64}
+platform_bits = _bits[platform.architecture()[0]]
+
 if sys.platform == 'win32':
     default_lib_dirs = ['C:\\',
                         os.path.join(distutils.sysconfig.EXEC_PREFIX,
@@ -145,13 +150,7 @@
                             '/usr/include/suitesparse']
     default_src_dirs = ['.','/usr/local/src', '/opt/src','/sw/src']
 
-    try:
-        platform = os.uname()
-        bit64 = platform[-1].endswith('64')
-    except:
-        bit64 = False
-
-    if bit64:
+    if platform_bits == 64:
         default_x11_lib_dirs = ['/usr/lib64']
     else:
         default_x11_lib_dirs = ['/usr/X11R6/lib','/usr/X11/lib','/usr/lib']



More information about the Numpy-svn mailing list