diff --git a/ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/client.py b/ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/client.py index 72fcb2f89..29f77da9f 100644 --- a/ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/client.py +++ b/ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/client.py @@ -168,10 +168,11 @@ def __enter__(self): return self def __exit__(self, exc_type, exc, tb): - try: - self.close() - finally: - return False + # close() is best-effort and swallows its own errors, so a plain call is safe here. + # Returning False (i.e., not suppressing the original exception) is the same behavior + # as the previous try/finally, without the `return in finally` SyntaxWarning on Python 3.14+. + self.close() + return False def close(self) -> None: """Close the underlying gRPC channel."""