forked from jazzband/django-push-notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Spomotion/fix/support-python-plus-10
Support Python verion +10
- Loading branch information
Showing
1 changed file
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
try: | ||
# Python 3.8+ | ||
import importlib.metadata as importlib_metadata | ||
# Python 3.8+ | ||
import importlib.metadata as importlib_metadata | ||
|
||
try: | ||
# Ugly hack for APNS sub-deps Python 3.10+ | ||
import collections | ||
from collections.abc import Iterable, Mapping, MutableMapping, MutableSet | ||
|
||
collections.Iterable = Iterable | ||
collections.Mapping = Mapping | ||
collections.MutableSet = MutableSet | ||
collections.MutableMapping = MutableMapping | ||
except ImportError: | ||
pass | ||
|
||
except ImportError: | ||
# <Python 3.7 and lower | ||
import importlib_metadata | ||
# <Python 3.7 and lower | ||
import importlib_metadata | ||
|
||
__version__ = importlib_metadata.version("django-push-notifications") |