Skip to content

Commit a64b3a3

Browse files
authored
Merge pull request #1525 from burnash/fix/creds-mentioned-before-assignment
rearrange flow to remove reference to `creds`
2 parents a8be3b9 + f8cc057 commit a64b3a3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gspread/auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,10 @@ def oauth_from_dict(
284284

285285
if authorized_user_info is not None:
286286
creds = OAuthCredentials.from_authorized_user_info(authorized_user_info, scopes)
287-
288-
if not creds and credentials is not None:
287+
elif credentials is not None:
289288
creds = flow(client_config=credentials, scopes=scopes)
289+
else:
290+
raise ValueError("no credentials object supplied")
290291

291292
client = Client(auth=creds, http_client=http_client)
292293

0 commit comments

Comments
 (0)