From ec01ae17a2d45eb003f3bfde7d7638e4a29f84c5 Mon Sep 17 00:00:00 2001 From: alifeee Date: Wed, 31 Jan 2024 16:47:06 +0000 Subject: [PATCH 1/2] check oauth creds type using `isinstance` instead of `type()` --- gspread/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gspread/auth.py b/gspread/auth.py index 49a70e571..635f5a2be 100644 --- a/gspread/auth.py +++ b/gspread/auth.py @@ -189,7 +189,7 @@ def oauth( authorized_user_filename = Path(authorized_user_filename) creds = load_credentials(filename=authorized_user_filename) - if not type(creds) is Credentials: + if not isinstance(creds, OAuthCredentials): with open(credentials_filename) as json_file: client_config = json.load(json_file) creds = flow(client_config=client_config, scopes=scopes) From 0e42594284048bd8c23d46a7be3004673e10fe46 Mon Sep 17 00:00:00 2001 From: alifeee Date: Wed, 31 Jan 2024 23:39:42 +0000 Subject: [PATCH 2/2] OAuthCredentials -> Credentials --- gspread/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gspread/auth.py b/gspread/auth.py index 635f5a2be..d1c60402d 100644 --- a/gspread/auth.py +++ b/gspread/auth.py @@ -189,7 +189,7 @@ def oauth( authorized_user_filename = Path(authorized_user_filename) creds = load_credentials(filename=authorized_user_filename) - if not isinstance(creds, OAuthCredentials): + if not isinstance(creds, Credentials): with open(credentials_filename) as json_file: client_config = json.load(json_file) creds = flow(client_config=client_config, scopes=scopes)