[PyQt] Another minor tweak to configure.py

Giovanni Bajo rasky at develer.com
Thu Jun 28 00:48:58 BST 2007


Hi,

this small patchlet avoid calling abspath() on $PATH elements. Under Windows, 
$PATH elements can have leading or trailing whitespaces, which are ignored 
(aka stripped); abspath() is not ready to handle that:

[E:\work]python
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import os
 >>> os.path.abspath(" c:\\windows")
'E:\\work\\ c:\\windows'

I have no clue whether this can be considered a bug in abspath() or not. 
Anyway, calling abspath is redundant and useless since there are no relative 
paths in $PATH.

Index: configure.py
===================================================================
--- configure.py        (revision 13265)
+++ configure.py        (working copy)
@@ -1629,7 +1629,7 @@
      global opt_qmake

      for d in path.split(os.pathsep):
-        opt_qmake = os.path.join(os.path.abspath(d), base_qmake)
+        opt_qmake = os.path.join(d, base_qmake)

          if os.access(opt_qmake, os.X_OK):
              break

-- 
Giovanni Bajo



More information about the PyQt mailing list