mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
tools: avoid returning from finally blocks
Python warns about return statements inside finally blocks because they can suppress pending exceptions. Move the returns after the try/finally and try/except bodies so normal return values stay the same while unexpected exceptions are no longer swallowed. Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
This commit is contained in:
parent
1fc6f2bac8
commit
a9e6460261
2 changed files with 3 additions and 3 deletions
|
|
@ -284,7 +284,8 @@ class connectNuttx(object):
|
|||
|
||||
if self.method != "minicom":
|
||||
time.sleep(0.5)
|
||||
return ret
|
||||
|
||||
return ret
|
||||
|
||||
def switch_to_original_core(self):
|
||||
if self.target == "target":
|
||||
|
|
|
|||
|
|
@ -310,8 +310,7 @@ class NetCheck(gdb.Command):
|
|||
result = max(result, NetCheckResult.FAILED)
|
||||
message.append("[FAILED] Failed to check IOB: %s" % e)
|
||||
|
||||
finally:
|
||||
return result, message
|
||||
return result, message
|
||||
|
||||
def invoke(self, args, from_tty):
|
||||
if utils.get_symbol_value("CONFIG_MM_IOB"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue