Skip to content

Commit c30a6a7

Browse files
authored
fix: fix type error in credentials.py for python 3.7 and 3.8 (#1805)
* fix: fix type error in credentials.py for python 3.7 and 3.8 * fix linting error
1 parent 03dfee2 commit c30a6a7

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
@@ -18,6 +18,7 @@
1818
import abc
1919
from enum import Enum
2020
import os
21+
from typing import List
2122

2223
from google.auth import _helpers, environment_vars
2324
from google.auth import exceptions
@@ -27,7 +28,7 @@
2728
from google.auth._refresh_worker import RefreshThreadManager
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)