Skip to content

Commit cf0fe33

Browse files
committed
fix type error in credentials.py for python 3.7 and 3.8
1 parent 99be2ce commit cf0fe33

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

google/auth/credentials.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
from google.auth._credentials_base import _BaseCredentials
2626
from google.auth._default import _LOGGER
2727
from google.auth._refresh_worker import RefreshThreadManager
28+
from typing import List
2829

2930
DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"
30-
NO_OP_TRUST_BOUNDARY_LOCATIONS: list[str] = []
31+
NO_OP_TRUST_BOUNDARY_LOCATIONS: List[str] = []
3132
NO_OP_TRUST_BOUNDARY_ENCODED_LOCATIONS = "0x0"
3233

3334

@@ -434,13 +435,12 @@ def _build_trust_boundary_lookup_url(self):
434435
def _has_no_op_trust_boundary(self):
435436
# A no-op trust boundary is indicated by encodedLocations being "0x0".
436437
# The "locations" list may or may not be present as an empty list.
437-
if (
438-
self._trust_boundary is not None
439-
and self._trust_boundary["encodedLocations"]
438+
if self._trust_boundary is None:
439+
return False
440+
return (
441+
self._trust_boundary.get("encodedLocations")
440442
== NO_OP_TRUST_BOUNDARY_ENCODED_LOCATIONS
441-
):
442-
return True
443-
return False
443+
)
444444

445445

446446
class AnonymousCredentials(Credentials):

0 commit comments

Comments
 (0)