Skip to content

Commit 67144c9

Browse files
authored
Add deprecation warning for 3.4, 3.5 (#1541)
1 parent 8b1e8ce commit 67144c9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

sentry_sdk/hub.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,20 @@ def __exit__(self, exc_type, exc_value, tb):
9696
c.close()
9797

9898

99+
def _check_python_deprecations():
100+
# type: () -> None
101+
version = sys.version_info[:2]
102+
103+
if version == (3, 4) or version == (3, 5):
104+
logger.warning(
105+
"sentry-sdk 2.0.0 will drop support for Python %s.",
106+
"{}.{}".format(*version),
107+
)
108+
logger.warning(
109+
"Please upgrade to the latest version to continue receiving upgrades and bugfixes."
110+
)
111+
112+
99113
def _init(*args, **kwargs):
100114
# type: (*Optional[str], **Any) -> ContextManager[Any]
101115
"""Initializes the SDK and optionally integrations.
@@ -104,6 +118,7 @@ def _init(*args, **kwargs):
104118
"""
105119
client = Client(*args, **kwargs) # type: ignore
106120
Hub.current.bind_client(client)
121+
_check_python_deprecations()
107122
rv = _InitGuard(client)
108123
return rv
109124

0 commit comments

Comments
 (0)