[jhbuild] don't fail reading the default configuration if os.uname doesn't exist



commit 0298a7696a50054b7723e16fb1dd455368c4ba69
Author: Frédéric Péters <fpeters 0d be>
Date:   Thu May 21 19:40:18 2009 +0200

    don't fail reading the default configuration if os.uname doesn't exist
---
 jhbuild/defaults.jhbuildrc |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/jhbuild/defaults.jhbuildrc b/jhbuild/defaults.jhbuildrc
index aaaef69..35bfe27 100644
--- a/jhbuild/defaults.jhbuildrc
+++ b/jhbuild/defaults.jhbuildrc
@@ -98,11 +98,15 @@ copy_dir = None
 # whether to install to lib64 directories?  Currently this will default to
 # True on Linux AMD64, PPC64 or S390x systems, and False everywhere else.
 # Patches accepted to fix the default for other architectures.
-uname = os.uname()
-use_lib64 = (uname[0], uname[4]) in [ ('Linux', 'x86_64'),
-                                      ('Linux', 'ppc64'),
-                                      ('Linux', 's390x') ]
-del uname
+try:
+    uname = os.uname()
+    use_lib64 = (uname[0], uname[4]) in [ ('Linux', 'x86_64'),
+                                          ('Linux', 'ppc64'),
+                                          ('Linux', 's390x') ]
+    del uname
+except AttributeError:
+    # some platforms don't have os.uname (ie. Win32)
+    use_lib64 = False
 
 # default buildscript.  You should probably leave this as the default.
 # In particular, don't set it to 'gtk'.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]