aboutsummaryrefslogtreecommitdiffstats
path: root/qtinfo.py
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2016-09-24 11:33:36 +0200
committerChristian Tismer <tismer@stackless.com>2016-10-18 14:43:32 +0000
commit8c090690a206e83eba88fcf785b95932f7ad9203 (patch)
treea7239c1e182124da230418c42df8ba30417ffb6e /qtinfo.py
parent52f4ed0829bf8a47ad3cc16d7679d31ae645f17b (diff)
Make paths absolute in setup.py
The paths for "qmake" and "cmake" will not work when they are relative paths. This problem is pretty subtle, when setup.py breaks because it cannot create the simple list at line 712, variable "cmake_cmd". This innocent looking list is causing problems, because it uses qtinfo.py, and this is dependent on properties which call back into the subprocess module! The properties in qtinfo.py are now real properties, because their values are early computed in __init__. The problem is solved by this patch. Change-Id: I877b6644fa2909ca9ac1f23d4ce5accfc869716b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'qtinfo.py')
-rw-r--r--qtinfo.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/qtinfo.py b/qtinfo.py
index 6f81cca7a..1e3f278e0 100644
--- a/qtinfo.py
+++ b/qtinfo.py
@@ -8,6 +8,10 @@ class QtInfo(object):
self._qmake_command = qmake_command
else:
self._qmake_command = [find_executable("qmake"),]
+ self._dict = {}
+ # bind all variables early at __init__ time.
+ for thing in self.__class__.__dict__:
+ getattr(self, thing)
def getQMakeCommand(self):
qmake_command_string = self._qmake_command[0]
@@ -39,7 +43,7 @@ class QtInfo(object):
def getDocsPath(self):
return self.getProperty("QT_INSTALL_DOCS")
- def getProperty(self, prop_name):
+ def _getProperty(self, prop_name):
cmd = self._qmake_command + ["-query", prop_name]
proc = subprocess.Popen(cmd, stdout = subprocess.PIPE, shell=False)
prop = proc.communicate()[0]
@@ -50,6 +54,11 @@ class QtInfo(object):
return str(prop, 'ascii').strip()
return prop.strip()
+ def getProperty(self, prop_name):
+ if prop_name not in self._dict:
+ self._dict[prop_name] = self._getProperty(prop_name)
+ return self._dict[prop_name]
+
version = property(getVersion)
bins_dir = property(getBinsPath)
libs_dir = property(getLibsPath)