From 4fb3d70848afd5475710a5b8d9ebbedf244d3176 Mon Sep 17 00:00:00 2001 From: Ramona T Date: Wed, 25 Feb 2026 21:35:49 -0500 Subject: [PATCH] Resolve SIM107 in sshtunnel.py Resolves SyntaxWarning: 'return' in a 'finally' block --- sshtunnel.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sshtunnel.py b/sshtunnel.py index a7db0c4..c4a7120 100644 --- a/sshtunnel.py +++ b/sshtunnel.py @@ -1036,13 +1036,13 @@ def _read_ssh_config(ssh_host, except (AttributeError, TypeError): # ssh_config_file is None if logger: logger.info('Skipping loading of ssh configuration file') - finally: - return (ssh_host, - ssh_username or getpass.getuser(), - ssh_pkey, - int(ssh_port) if ssh_port else 22, # fallback value - ssh_proxy, - compression) + + return (ssh_host, + ssh_username or getpass.getuser(), + ssh_pkey, + int(ssh_port) if ssh_port else 22, # fallback value + ssh_proxy, + compression) @staticmethod def get_agent_keys(logger=None):