Skip to content

Commit 8f4bcc8

Browse files
authored
Fix #1915 with import of Sequence from typing module
1 parent 5c07e1c commit 8f4bcc8

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

google/auth/_default.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@
1717
Implements application default credentials and project ID detection.
1818
"""
1919

20-
from collections.abc import Sequence
20+
from __future__ import annotations
21+
2122
import io
2223
import json
2324
import logging
2425
import os
25-
from typing import Optional, TYPE_CHECKING
2626
import warnings
27+
from typing import TYPE_CHECKING
2728

28-
from google.auth import environment_vars
29-
from google.auth import exceptions
3029
import google.auth.transport._http_client
30+
from google.auth import environment_vars, exceptions
31+
32+
if TYPE_CHECKING: # pragma: NO COVER
33+
from typing import Optional, Sequence
3134

32-
if TYPE_CHECKING: # pragma: NO COVER
3335
from google.auth.credentials import Credentials # noqa: F401
3436
from google.auth.transport import Request # noqa: F401
3537

@@ -696,8 +698,10 @@ def default(
696698
If no credentials were found, or if the credentials found were
697699
invalid.
698700
"""
699-
from google.auth.credentials import with_scopes_if_required
700-
from google.auth.credentials import CredentialsWithQuotaProject
701+
from google.auth.credentials import (
702+
CredentialsWithQuotaProject,
703+
with_scopes_if_required,
704+
)
701705

702706
explicit_project_id = os.environ.get(
703707
environment_vars.PROJECT, os.environ.get(environment_vars.LEGACY_PROJECT)

0 commit comments

Comments
 (0)