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/_oauth2client.py b/google/auth/_oauth2client.py
index 3512e1d..95a9876 100644
--- a/google/auth/_oauth2client.py
+++ b/google/auth/_oauth2client.py
@@ -21,6 +21,8 @@
from __future__ import absolute_import
+import six
+
from google.auth import _helpers
import google.auth.app_engine
import google.auth.compute_engine
@@ -32,7 +34,7 @@
import oauth2client.contrib.gce
import oauth2client.service_account
except ImportError as caught_exc:
- raise ImportError("oauth2client is not installed.") from caught_exc
+ six.raise_from(ImportError("oauth2client is not installed."), caught_exc)
try:
import oauth2client.contrib.appengine # pytype: disable=import-error
@@ -164,4 +166,4 @@
return _CLASS_CONVERSION_MAP[credentials_class](credentials)
except KeyError as caught_exc:
new_exc = ValueError(_CONVERT_ERROR_TMPL.format(credentials_class))
- raise new_exc from caught_exc
+ six.raise_from(new_exc, caught_exc)