This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c2af2a0f07 tools: avoid returning from finally blocks
1c2af2a0f07 is described below

commit 1c2af2a0f07d12eb828029fd53181fdf5817e3d0
Author: Old-Ding <[email protected]>
AuthorDate: Mon Jul 6 01:34:16 2026 +0800

    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 <[email protected]>
---
 tools/ci/testrun/utils/common.py | 3 ++-
 tools/pynuttx/nxgdb/net.py       | 3 +--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/ci/testrun/utils/common.py b/tools/ci/testrun/utils/common.py
index b5d76a68797..230369c2b1e 100644
--- a/tools/ci/testrun/utils/common.py
+++ b/tools/ci/testrun/utils/common.py
@@ -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":
diff --git a/tools/pynuttx/nxgdb/net.py b/tools/pynuttx/nxgdb/net.py
index 95f6680127f..8e708320a84 100644
--- a/tools/pynuttx/nxgdb/net.py
+++ b/tools/pynuttx/nxgdb/net.py
@@ -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"):

Reply via email to