fix jade detection. Scons ships with outdated subprocess module
This commit is contained in:
parent
795eba7c3b
commit
2c1e494147
|
|
@ -1,8 +1,8 @@
|
||||||
#
|
#
|
||||||
# SCons DSSSL processor check
|
# SCons DSSSL processor check
|
||||||
#
|
#
|
||||||
# Version 1.0
|
# Version 1.1
|
||||||
# 07-Sep-2014
|
# 08-Sep-2014
|
||||||
#
|
#
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
@ -11,11 +11,13 @@ def checkDSSSLProcessor(check, name="jade"):
|
||||||
"""Check if DSSSL engine is working. Returns True or False."""
|
"""Check if DSSSL engine is working. Returns True or False."""
|
||||||
check.Message("Checking if DSSSL processor "+name+" works... ")
|
check.Message("Checking if DSSSL processor "+name+" works... ")
|
||||||
try:
|
try:
|
||||||
echo = subprocess.Popen(('/bin/echo','""'), stdout = subprocess.PIPE )
|
echo = subprocess.Popen(['/bin/echo', '""'], stdout = subprocess.PIPE )
|
||||||
version = subprocess.check_output((name, '-v'), stdin = echo.stdout, stderr = subprocess.STDOUT )
|
version = subprocess.Popen([name, '-v'], stdin = echo.stdout, stdout= subprocess.PIPE, stderr = subprocess.PIPE )
|
||||||
except subprocess.CalledProcessError as e:
|
stderr = repr(version.communicate()[1])
|
||||||
if "version" in e.output:
|
if "version" in stderr:
|
||||||
check.Result(True)
|
check.Result(True)
|
||||||
return True
|
return True
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
pass
|
||||||
check.Result(False)
|
check.Result(False)
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user