Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 71e6e8e

Browse files
authored
chore: dedent deprecation warning message (#1932)
The indentation and leading/trailing newlines made it a little harder than necessary to `filterwarnings` the deprecation warning. (For instance, for pytest's filterwarnings, you'd need `"ignore:\\s+You are using a Python version 3.8:FutureWarning",`...)
1 parent f2ac281 commit 71e6e8e

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

google/auth/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ class Python37DeprecationWarning(DeprecationWarning): # pragma: NO COVER
4242

4343

4444
# Raise warnings for deprecated versions
45-
eol_message = """
46-
You are using a Python version {} past its end of life. Google will update
47-
google-auth with critical bug fixes on a best-effort basis, but not
48-
with any other fixes or features. Please upgrade your Python version,
49-
and then update google-auth.
50-
"""
45+
eol_message = (
46+
"You are using a Python version {} past its end of life. Google will update "
47+
"google-auth with critical bug fixes on a best-effort basis, but not "
48+
"with any other fixes or features. Please upgrade your Python version, "
49+
"and then update google-auth."
50+
)
5151
if sys.version_info.major == 3 and sys.version_info.minor == 8: # pragma: NO COVER
5252
warnings.warn(eol_message.format("3.8"), FutureWarning)
5353
elif sys.version_info.major == 3 and sys.version_info.minor == 9: # pragma: NO COVER

google/oauth2/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ class Python37DeprecationWarning(DeprecationWarning): # pragma: NO COVER
2828

2929

3030
# Raise warnings for deprecated versions
31-
eol_message = """
32-
You are using a Python version {} past its end of life. Google will update
33-
google-auth with critical bug fixes on a best-effort basis, but not
34-
with any other fixes or features. Please upgrade your Python version,
35-
and then update google-auth.
36-
"""
31+
eol_message = (
32+
"You are using a Python version {} past its end of life. Google will update "
33+
"google-auth with critical bug fixes on a best-effort basis, but not "
34+
"with any other fixes or features. Please upgrade your Python version, "
35+
"and then update google-auth."
36+
)
3737
if sys.version_info.major == 3 and sys.version_info.minor == 8: # pragma: NO COVER
3838
warnings.warn(eol_message.format("3.8"), FutureWarning)
3939
elif sys.version_info.major == 3 and sys.version_info.minor == 9: # pragma: NO COVER

0 commit comments

Comments
 (0)