Skip to content

Commit 7074131

Browse files
Adds a deprection warning for python <= 3.9 (#787)
* Adds a deprection warning for python <= 3.9 Python 3.9 is EOL in 10/2025. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6115194 commit 7074131

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ coverage.xml
2424

2525
# vscode files
2626
.vscode/*
27+
28+
dist/

push_notifications/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1+
import sys
2+
import warnings
3+
14
try:
25
# Python 3.8+
36
import importlib.metadata as importlib_metadata
47
except ImportError:
58
# <Python 3.7 and lower
69
import importlib_metadata
710

11+
if sys.version_info < (3, 10):
12+
warnings.warn(
13+
"Python 3.9 and earlier support is deprecated and will be removed in a future version. "
14+
"Please upgrade to Python 3.10 or later.",
15+
UserWarning,
16+
stacklevel=2
17+
)
18+
819
__version__ = importlib_metadata.version("django-push-notifications")

0 commit comments

Comments
 (0)