aboutsummaryrefslogtreecommitdiffstats
path: root/qtinfo.py
diff options
context:
space:
mode:
authorRoman Lacko <backup.rlacko@gmail.com>2012-09-07 15:39:28 +0200
committerRoman Lacko <backup.rlacko@gmail.com>2012-09-07 15:39:28 +0200
commit9a1ce0d52db45c2f320202ad949f37185a491216 (patch)
tree77ff23450ae5bb20662cdc1b834eb5b4b295848c /qtinfo.py
parente4d591c211be0fb3f8f221462443377a657a8903 (diff)
Don't use custom popenasync module on linux to run commands. This fixes following error: can't concatenate bytes to None
Diffstat (limited to 'qtinfo.py')
-rw-r--r--qtinfo.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/qtinfo.py b/qtinfo.py
index e638f90a..0cf13286 100644
--- a/qtinfo.py
+++ b/qtinfo.py
@@ -1,6 +1,6 @@
+import sys
import subprocess
from distutils.spawn import find_executable
-from popenasync import Popen
class QtInfo(object):
def __init__(self, qmake_path=None):
@@ -32,18 +32,13 @@ class QtInfo(object):
def getProperty(self, prop_name):
cmd = [self._qmake_path, "-query", prop_name]
- proc = Popen(cmd,
- stdin = subprocess.PIPE,
- stdout = subprocess.PIPE,
- stderr = subprocess.STDOUT,
- universal_newlines = 1,
- shell=False)
- prop = ''
- while proc.poll() is None:
- prop += proc.read_async(wait=0.1, e=0)
+ proc = subprocess.Popen(cmd, stdout = subprocess.PIPE, shell=False)
+ prop = proc.communicate()[0]
proc.wait()
if proc.returncode != 0:
return None
+ if sys.version_info >= (3,):
+ return str(prop, 'ascii').strip()
return prop.strip()
version = property(getVersion)