From 32564484bbd356a2ce29139c6cb73c23061b99a2 Mon Sep 17 00:00:00 2001 From: davidlm Date: Thu, 19 Oct 2023 09:04:51 -0400 Subject: [PATCH] clean up _resolve_account_id_builtin --- botocore/regions.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/botocore/regions.py b/botocore/regions.py index 062cce6ca4..aec02355c9 100644 --- a/botocore/regions.py +++ b/botocore/regions.py @@ -583,7 +583,6 @@ def _get_provider_params( def _resolve_account_id_builtin(self, builtins): """Resolve the ``AWS::Auth::AccountId`` builtin.""" - # do this check separately so mode is only validated if it's being used if 'AccountId' not in self._param_definitions: return @@ -592,9 +591,8 @@ def _resolve_account_id_builtin(self, builtins): if not self._should_resolve_account_id_builtin(): # Unset the account ID if endpoint mode is disabled. builtins[acct_id_builtin_key] = None - return - if builtins.get(acct_id_builtin_key) is None: + elif builtins.get(acct_id_builtin_key) is None: self._do_resolve_account_id_builtin(builtins) def _validate_account_id_endpoint_mode(self):