Skip to content

Commit 4b0701b

Browse files
Fix deprecations (#316)
* [fix] DeprecationWarning for import Mapping , Iterable from collections lib in files : jws.py , jwt.py * fmt --------- Co-authored-by: RaoufJabriSamsaIT <[email protected]>
1 parent b5cdc90 commit 4b0701b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

jose/jws.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import binascii
22
import json
3-
from collections.abc import Iterable, Mapping
3+
4+
try:
5+
from collections.abc import Iterable, Mapping
6+
except ImportError:
7+
from collections import Mapping, Iterable
48

59
from jose import jwk
610
from jose.backends.base import Key

jose/jwt.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import json
22
from calendar import timegm
3-
from collections.abc import Mapping
3+
4+
try:
5+
from collections.abc import Mapping
6+
except ImportError:
7+
from collections import Mapping
48
from datetime import datetime, timedelta
59

610
from jose import jws

0 commit comments

Comments
 (0)