aboutsummaryrefslogtreecommitdiff
path: root/lava_dispatcher/shell.py
diff options
context:
space:
mode:
authorRémi Duraffort <remi.duraffort@linaro.org>2017-11-17 10:02:42 +0100
committerRémi Duraffort <remi.duraffort@linaro.org>2017-11-17 11:45:10 +0100
commit334ccaaba3ef4233b39ced2618732e9d14d962c5 (patch)
tree85abf50f5aecde6670e4455eb662bd20501ebb4a /lava_dispatcher/shell.py
parent6a7bf9d52ad27edc47e852d31ada583c901d6af8 (diff)
Never return/break/continue in finally block
prospector error message: lost-exception / return statement in finally block may swallow exception For instance, calling foo() will return 1, without raising the exception. def foo(): try: raise Exception() finally: return 1 Change-Id: Ic3ae097a24d56af366cf3c2c1ca1c5544efd4255
Diffstat (limited to 'lava_dispatcher/shell.py')
-rw-r--r--lava_dispatcher/shell.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lava_dispatcher/shell.py b/lava_dispatcher/shell.py
index 29a1a4a7b..1c1d8b5f2 100644
--- a/lava_dispatcher/shell.py
+++ b/lava_dispatcher/shell.py
@@ -272,9 +272,10 @@ class ShellSession(Connection):
[pexpect.EOF, pexpect.TIMEOUT], timeout=timeout)
finally:
self.raw_connection.logfile.is_feedback = False
- if index == 1:
- return len(self.raw_connection.before)
- return index
+
+ if index == 1:
+ return len(self.raw_connection.before)
+ return index
class ExpectShellSession(Action):