diff --git a/jose/jws.py b/jose/jws.py index f82b695d..27f6b79a 100644 --- a/jose/jws.py +++ b/jose/jws.py @@ -1,6 +1,10 @@ import binascii import json -from collections.abc import Iterable, Mapping + +try: + from collections.abc import Iterable, Mapping +except ImportError: + from collections import Mapping, Iterable from jose import jwk from jose.backends.base import Key diff --git a/jose/jwt.py b/jose/jwt.py index 307db27b..b364b4ba 100644 --- a/jose/jwt.py +++ b/jose/jwt.py @@ -1,6 +1,10 @@ import json from calendar import timegm -from collections.abc import Mapping + +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping from datetime import datetime, timedelta from jose import jws