diff --git a/jose/jws.py b/jose/jws.py index 119d966..5a58330 100644 --- a/jose/jws.py +++ b/jose/jws.py @@ -3,7 +3,10 @@ import json import six -from collections import Mapping, Iterable +try: + from collections.abc import Mapping, Iterable +except ImportError: + from collections import Mapping, Iterable from jose import jwk from jose.constants import ALGORITHMS diff --git a/jose/jwt.py b/jose/jwt.py index 2128c85..8d7d237 100644 --- a/jose/jwt.py +++ b/jose/jwt.py @@ -3,11 +3,15 @@ import json from calendar import timegm -from collections import Mapping from datetime import datetime from datetime import timedelta from six import string_types +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping + from jose import jws from .exceptions import JWSError