> 
> $ python setup.py build --compiler=mingw32
> 
> Traceback (most recent call last):
>   File "setup.py", line 212, in ?
>     if libglade.can_build():
>   File "dsextras.py", line 175, in can_build
>     version = map(int, orig_version.split('.'))
> ValueError: invalid literal for int():


The traceback is a bit bad, I think it's because os.system returns
different values on failure.

Could someone test and verify that the following patch works?

Index: dsextras.py
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/dsextras.py,v
retrieving revision 1.6
diff -u -u -r1.6 dsextras.py
--- dsextras.py 27 Feb 2003 12:57:43 -0000      1.6
+++ dsextras.py 18 Mar 2003 12:40:39 -0000
@@ -42,6 +42,15 @@
         if getstatusoutput('pkg-config')[0] == 256:
             return 1
 
+def have_package(pkgname):
+    """Checks for the existence of pkg-config"""
+    if (sys.platform == 'win32' and
+        os.system('pkg-config --exist %s > NUL' % pkgname) == 0):
+        return 1
+    else:
+        if getstatusoutput('pkg-config --exist %s' % pkgname)[0] ==
256:
+            return 1
+
 def list_files(dir):
     """List all files in a dir, with filename match support:
     for example: glade/*.glade will return all files in the glade
directory
@@ -62,15 +71,14 @@
     return retval
 
 def pkgc_version_check(name, longname, req_version):
-    is_installed = not os.system('pkg-config --exists %s' % name)
-    if not is_installed:
+    if not have_package(name):
         print "Could not find %s" % longname
         return 0

-- 
Johan Dahlin <[EMAIL PROTECTED]>
Async Open Source

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to