mirror of https://gitlab.com/ita1024/waf.git
cleanup
This commit is contained in:
parent
2263d60b8d
commit
4404d9062c
|
@ -1014,11 +1014,11 @@ def get_cc_version(conf, cc, gcc=False, icc=False):
|
|||
p = Utils.subprocess.Popen(cmd, stdin=Utils.subprocess.PIPE, stdout=Utils.subprocess.PIPE, stderr=Utils.subprocess.PIPE, env=env)
|
||||
p.stdin.write('\n'.encode())
|
||||
out = p.communicate()[0]
|
||||
except:
|
||||
except Exception:
|
||||
conf.fatal('Could not determine the compiler version %r' % cmd)
|
||||
|
||||
if not isinstance(out, str):
|
||||
out = out.decode(sys.stdout.encoding)
|
||||
out = out.decode(sys.stdout.encoding or 'iso8859-1')
|
||||
|
||||
if gcc:
|
||||
if out.find('__INTEL_COMPILER') >= 0:
|
||||
|
@ -1031,7 +1031,7 @@ def get_cc_version(conf, cc, gcc=False, icc=False):
|
|||
|
||||
k = {}
|
||||
if icc or gcc:
|
||||
out = out.split('\n')
|
||||
out = out.splitlines()
|
||||
for line in out:
|
||||
lst = shlex.split(line)
|
||||
if len(lst)>2:
|
||||
|
|
|
@ -336,15 +336,14 @@ def getoutput(conf, cmd, stdin=False):
|
|||
p = Utils.subprocess.Popen(cmd, stdin=stdin, stdout=Utils.subprocess.PIPE, stderr=Utils.subprocess.PIPE, env=env)
|
||||
if stdin:
|
||||
p.stdin.write('\n'.encode())
|
||||
stdout, stderr = p.communicate()
|
||||
except:
|
||||
out, err = p.communicate()
|
||||
except Exception:
|
||||
conf.fatal('could not determine the compiler version %r' % cmd)
|
||||
else:
|
||||
if not isinstance(stdout, str):
|
||||
stdout = stdout.decode(sys.stdout.encoding)
|
||||
if not isinstance(stderr, str):
|
||||
stderr = stderr.decode(sys.stdout.encoding)
|
||||
return stdout, stderr
|
||||
if not isinstance(out, str):
|
||||
out = out.decode(sys.stdout.encoding or 'iso8859-1')
|
||||
if not isinstance(err, str):
|
||||
err = err.decode(sys.stdout.encoding or 'iso8859-1')
|
||||
return (out, err)
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue