fix: add back python 2.7 for gcloud usage only (#892)
* fix: add back python 2.7 for gcloud
* fix: fix setup and tests
* fix: add enum34 for python 2.7
* fix: add app engine app and fix noxfile
* fix: move test_app_engine.py
* fix: fix downscoped
* fix: fix downscoped
* fix: remove py2 from classifiers
diff --git a/google/auth/downscoped.py b/google/auth/downscoped.py
index 96a4e65..a1d7b6e 100644
--- a/google/auth/downscoped.py
+++ b/google/auth/downscoped.py
@@ -50,6 +50,8 @@
import datetime
+import six
+
from google.auth import _helpers
from google.auth import credentials
from google.oauth2 import sts
@@ -221,7 +223,7 @@
Raises:
TypeError: If the value is not a string.
"""
- if not isinstance(value, str):
+ if not isinstance(value, six.string_types):
raise TypeError("The provided available_resource is not a string.")
self._available_resource = value
@@ -247,7 +249,7 @@
ValueError: If the value is not valid.
"""
for available_permission in value:
- if not isinstance(available_permission, str):
+ if not isinstance(available_permission, six.string_types):
raise TypeError(
"Provided available_permissions are not a list of strings."
)
@@ -350,7 +352,7 @@
Raises:
TypeError: If the value is not of type string.
"""
- if not isinstance(value, str):
+ if not isinstance(value, six.string_types):
raise TypeError("The provided expression is not a string.")
self._expression = value
@@ -373,7 +375,7 @@
Raises:
TypeError: If the value is not of type string or None.
"""
- if not isinstance(value, str) and value is not None:
+ if not isinstance(value, six.string_types) and value is not None:
raise TypeError("The provided title is not a string or None.")
self._title = value
@@ -396,7 +398,7 @@
Raises:
TypeError: If the value is not of type string or None.
"""
- if not isinstance(value, str) and value is not None:
+ if not isinstance(value, six.string_types) and value is not None:
raise TypeError("The provided description is not a string or None.")
self._description = value