From f8cc057d34f5fed93fad4c372180a404b05069f2 Mon Sep 17 00:00:00 2001 From: alifeee Date: Fri, 25 Oct 2024 16:36:10 +0100 Subject: [PATCH] rearrange flow to remove reference to `creds` --- gspread/auth.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gspread/auth.py b/gspread/auth.py index e5547aa2..b1f42542 100644 --- a/gspread/auth.py +++ b/gspread/auth.py @@ -284,9 +284,10 @@ def oauth_from_dict( if authorized_user_info is not None: creds = OAuthCredentials.from_authorized_user_info(authorized_user_info, scopes) - - if not creds and credentials is not None: + elif credentials is not None: creds = flow(client_config=credentials, scopes=scopes) + else: + raise ValueError("no credentials object supplied") client = Client(auth=creds, http_client=http_client)