aboutsummaryrefslogtreecommitdiff
path: root/google/auth/_helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'google/auth/_helpers.py')
-rw-r--r--google/auth/_helpers.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/google/auth/_helpers.py b/google/auth/_helpers.py
index b239fcd..1b08ab8 100644
--- a/google/auth/_helpers.py
+++ b/google/auth/_helpers.py
@@ -17,6 +17,7 @@
import base64
import calendar
import datetime
+import sys
import six
from six.moves import urllib
@@ -233,3 +234,12 @@ def unpadded_urlsafe_b64encode(value):
Union[str|bytes]: The encoded value
"""
return base64.urlsafe_b64encode(value).rstrip(b"=")
+
+
+def is_python_3():
+ """Check if the Python interpreter is Python 2 or 3.
+
+ Returns:
+ bool: True if the Python interpreter is Python 3 and False otherwise.
+ """
+ return sys.version_info > (3, 0)