fix!: drop support for Python 2.7 (#778)
Drop use of 'six' wrapper library.
Drop 'u"' prefixes.
Drop support for app_engine 'classic' mode (Python 2.7-only).
Release-As: 2.0.0b1
Closes #777.
diff --git a/google/oauth2/id_token.py b/google/oauth2/id_token.py
index 540ccd1..25492ca 100644
--- a/google/oauth2/id_token.py
+++ b/google/oauth2/id_token.py
@@ -55,12 +55,10 @@
.. _CacheControl: https://cachecontrol.readthedocs.io
"""
+import http.client
import json
import os
-import six
-from six.moves import http_client
-
from google.auth import environment_vars
from google.auth import exceptions
from google.auth import jwt
@@ -97,7 +95,7 @@
"""
response = request(certs_url, method="GET")
- if response.status != http_client.OK:
+ if response.status != http.client.OK:
raise exceptions.TransportError(
"Could not fetch certificates at {}".format(certs_url)
)
@@ -242,10 +240,10 @@
"GOOGLE_APPLICATION_CREDENTIALS is not valid service account credentials.",
caught_exc,
)
- six.raise_from(new_exc, caught_exc)
+ raise new_exc from caught_exc
- # 2. Try to fetch ID token from metada server if it exists. The code works for GAE and
- # Cloud Run metadata server as well.
+ # 2. Try to fetch ID token from metada server if it exists. The code
+ # works for GAE and Cloud Run metadata server as well.
try:
from google.auth import compute_engine
from google.auth.compute_engine import _metadata