west: runners: core.py: Remove no-op try-excepts

Removing these doesn't change behavior, since the
subprocess.CalledProcessError is just immediately re-raised when caught.

Fixes this pylint warning:

    W0706: The except handler raises immediately (try-except-raise)

Fixing pylint warnings for a CI check.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2019-09-03 19:09:30 +02:00 committed by Anas Nashif
commit d2d5fae838

View file

@ -516,10 +516,7 @@ class ZephyrBinaryRunner(abc.ABC):
self._log_cmd(cmd)
if _DRY_RUN:
return
try:
subprocess.check_call(cmd)
except subprocess.CalledProcessError:
raise
subprocess.check_call(cmd)
def check_output(self, cmd):
'''Subclass subprocess.check_output() wrapper.
@ -531,10 +528,7 @@ class ZephyrBinaryRunner(abc.ABC):
self._log_cmd(cmd)
if _DRY_RUN:
return b''
try:
return subprocess.check_output(cmd)
except subprocess.CalledProcessError:
raise
return subprocess.check_output(cmd)
def popen_ignore_int(self, cmd):
'''Spawn a child command, ensuring it ignores SIGINT.