mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #1944 from mbedmicro/ctrl-c-traceback
Fixes the python traceback when the user does ctrl+c during compilationpull/1949/head
commit
2a4a02caa7
|
@ -41,7 +41,11 @@ CPU_COUNT_MIN = 1
|
|||
def compile_worker(job):
|
||||
results = []
|
||||
for command in job['commands']:
|
||||
_, _stderr, _rc = run_cmd(command, job['work_dir'])
|
||||
try:
|
||||
_, _stderr, _rc = run_cmd(command, job['work_dir'])
|
||||
except KeyboardInterrupt as e:
|
||||
raise ToolException
|
||||
|
||||
results.append({
|
||||
'code': _rc,
|
||||
'output': _stderr,
|
||||
|
|
|
@ -38,9 +38,10 @@ def run_cmd(command, wd=None, redirect=False):
|
|||
try:
|
||||
p = Popen(command, stdout=PIPE, stderr=STDOUT if redirect else PIPE, cwd=wd)
|
||||
_stdout, _stderr = p.communicate()
|
||||
except:
|
||||
except OSError as e:
|
||||
print "[OS ERROR] Command: "+(' '.join(command))
|
||||
raise
|
||||
|
||||
return _stdout, _stderr, p.returncode
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue