提交 326abfbe authored 作者: abalkin's avatar abalkin 提交者: Alexander Belopolsky

Fixed a bug introduced in previous commit. NB: install before testing under py3k.

上级 a02bc80d
...@@ -13,6 +13,7 @@ import subprocess ...@@ -13,6 +13,7 @@ import subprocess
import sys import sys
import tempfile import tempfile
import time import time
import itertools
import distutils.sysconfig import distutils.sysconfig
...@@ -1547,7 +1548,7 @@ class GCC_compiler(object): ...@@ -1547,7 +1548,7 @@ class GCC_compiler(object):
stderr = decode_iter(p.stderr.readlines()) stderr = decode_iter(p.stderr.readlines())
lines = [] lines = []
if parse: if parse:
for line in stdout + stderr: for line in itertools.chain(stdout, stderr):
if "COLLECT_GCC_OPTIONS=" in line: if "COLLECT_GCC_OPTIONS=" in line:
continue continue
elif "-march=" in line and "-march=native" not in line: elif "-march=" in line and "-march=native" not in line:
...@@ -1556,11 +1557,8 @@ class GCC_compiler(object): ...@@ -1556,11 +1557,8 @@ class GCC_compiler(object):
lines.append(line.strip()) lines.append(line.strip())
lines = list(set(lines)) # to remove duplicate lines = list(set(lines)) # to remove duplicate
else: else:
lines = stdout + stderr lines = itertools.chain(stdout, stderr)
if PY3: return list(lines)
return [line.decode() for line in lines]
else:
return lines
# The '-' at the end is needed. Otherwise, g++ do not output # The '-' at the end is needed. Otherwise, g++ do not output
# enough information. # enough information.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论