[PyKDE] Bug in siputils.py (latest snapshot)

Giovanni Bajo rasky at develer.com
Mon Oct 24 15:34:39 BST 2005


Phil,

in siputils.h, parse_build_macros, there is a bug (around line 1809):


            rstart = mstart + 2
            if rstart < len(rhs) and rhs[rstart] == "{":
                rstart = rstart + 1
                term = "}"
            elif rstart < len(rhs) and rhs[rstart] == "[":
                rstart = rstart + 1
                term = "]"
            else:
                term = string.whitespace

            mend = rstart
            while mend < len(rhs) and rhs[mend] != term:
                mend = mend + 1

Since term can be a set of characers (string.whitespace), using != in the
loop is incorrect. Using "not in" fixed it:

            while mend < len(rhs) and rhs[mend] not in term:

The problem appears with specs/win32-msvc.net when trying to expand this
macro:

  QMAKE_CXXFLAGS_WARN_ON  = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189

because with the current code it doesn't find the space terminator so it
believes that "QMAKE_CFLAGS_WARN_ON -w34100 -w34189" is the macro name.
-- 
Giovanni Bajo




More information about the PyQt mailing list