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/impersonated_credentials.py b/google/auth/impersonated_credentials.py
index 2704bfd..b8a6c49 100644
--- a/google/auth/impersonated_credentials.py
+++ b/google/auth/impersonated_credentials.py
@@ -28,9 +28,11 @@
import base64
import copy
from datetime import datetime
-import http.client
import json
+import six
+from six.moves import http_client
+
from google.auth import _helpers
from google.auth import credentials
from google.auth import exceptions
@@ -98,7 +100,7 @@
else response.data
)
- if response.status != http.client.OK:
+ if response.status != http_client.OK:
exceptions.RefreshError(_REFRESH_ERROR, response_body)
try:
@@ -115,7 +117,7 @@
),
response_body,
)
- raise new_exc from caught_exc
+ six.raise_from(new_exc, caught_exc)
class Credentials(credentials.CredentialsWithQuotaProject, credentials.Signing):