From 5508fa6e246b9802b7470c07f880ca4894ead9a2 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Tue, 16 Jun 2026 10:58:50 +0800 Subject: [PATCH] qtvcp: move return out of finally in SAVE_PROGRAM return npath sat inside the finally block, which silently overrode the except branch's return None. SAVE_PROGRAM therefore returned a valid looking path even when the write failed, swallowing the exception. Dedenting it to the method body restores the intended error semantics and clears the SyntaxWarning Python 3.14 emits for return in finally. Fixes #4169. --- lib/python/qtvcp/qt_action.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/python/qtvcp/qt_action.py b/lib/python/qtvcp/qt_action.py index 3952200bda8..afe02a62b89 100644 --- a/lib/python/qtvcp/qt_action.py +++ b/lib/python/qtvcp/qt_action.py @@ -394,7 +394,7 @@ def SAVE_PROGRAM(self, source, fname, ending = '.ngc'): outfile.close() except: pass - return npath + return npath def SET_AXIS_ORIGIN(self, axis, value): if axis == '' or axis.upper() not in ("XYZABCUVW"):