summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2012-02-03 19:44:19 (GMT)
committerDavid Malcolm <dmalcolm@redhat.com>2012-02-03 19:44:19 (GMT)
commitf1e467197eba7d8537fcfa8d723276748931e95b (patch)
treeb30862a1cf4f041a04ebd972f9fc63aac7671ed6
parent0aa1c8bb7c02a11fd60629ea9559a6aefc7176e1 (diff)
downloadgcc-python-plugin-f1e467197eba7d8537fcfa8d723276748931e95b.zip
gcc-python-plugin-f1e467197eba7d8537fcfa8d723276748931e95b.tar.gz
gcc-python-plugin-f1e467197eba7d8537fcfa8d723276748931e95b.tar.xz
py3k fixes
-rw-r--r--configbuilder.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/configbuilder.py b/configbuilder.py
index d7f52fc..7fb1468 100644
--- a/configbuilder.py
+++ b/configbuilder.py
@@ -21,6 +21,7 @@ from subprocess import Popen, PIPE, check_output
import sys
def indent(prefix, text):
+ text = str(text)
return '\n'.join([prefix + line
for line in text.splitlines()])
@@ -137,8 +138,8 @@ class ConfigBuilder:
'-c', # don't run the linker (no main)
'-o', outpath,
srcpath] + extraargs
- p = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE)
- stdout, stderr = p.communicate(src)
+ p = Popen(args, stdout=PIPE, stderr=PIPE)
+ stdout, stderr = p.communicate()
c = p.wait()
if c != 0:
class CompilationError(ConfigurationFailure):
@@ -158,6 +159,7 @@ class ConfigBuilder:
mandatory=True) as test:
out = check_output(cmd,
shell=True) # input must be trusted
+ out = str(out.decode())
sys.stdout.write('%s\n' % out.strip())
return out