From 79573901d91e2fe8e325a2e13757fba6325f6138 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 18 Mar 2026 22:28:13 -0400 Subject: [PATCH] Fix SyntaxWarning on Python 3.14: move return out of finally blocks Python 3.14 emits SyntaxWarning for return statements inside finally blocks, as they silently swallow exceptions. This moves the return statements out of the finally blocks in list_call_get_all_results and list_call_get_all_results_generator, preserving identical behavior. --- src/oci_cli/cli_util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/oci_cli/cli_util.py b/src/oci_cli/cli_util.py index a1d4d03f..8fce54cc 100644 --- a/src/oci_cli/cli_util.py +++ b/src/oci_cli/cli_util.py @@ -2149,7 +2149,8 @@ def list_call_get_all_results(list_func_ref, ctx=None, is_json=False, stream_out headers = call_result.headers request = call_result.request final_response = Response(status, headers, post_processed_results, request) - return final_response + if stream_output: + return final_response if ctx and ctx.obj['debug']: print("", file=sys.stderr) @@ -2333,7 +2334,8 @@ def list_call_get_all_results_multiple_keys(list_func_ref, ctx=None, is_json=Fal headers = call_result.headers request = call_result.request final_response = Response(status, headers, post_processed_results, request) - return final_response + if stream_output: + return final_response if ctx and ctx.obj['debug']: print("", file=sys.stderr)