10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 04:43:50 +01:00

Remove check_call for python 2.6 suport...

This commit is contained in:
Thomas Applencourt 2015-05-26 11:39:39 +02:00
parent 9746c6df28
commit 1cce664e5f

View File

@ -473,13 +473,16 @@ def get_program(path_module):
import subprocess
try:
fnull = open(os.devnull, 'w')
cmd = 'grep -l "program" {0}/*.irp.f'.format(path_module.abs)
p = subprocess.check_output([cmd], shell=True, stderr=fnull)
except subprocess.CalledProcessError:
process = subprocess.Popen([cmd],shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
except OSError:
return []
else:
return [os.path.basename(f).split(".")[0] for f in p.split()]
if "No such file or directory" not in stdout:
return [os.path.basename(f).split(".")[0] for f in stdout.split()]
else:
return []
def ninja_binary_rule():