From 3890e0399569917fc74bb631250a8a95adb6b1b9 Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Sat, 11 Apr 2020 06:43:34 +0000 Subject: [PATCH] Import ABC from collections.abc instead of collections for Python 3 compatibility. --- jose/jws.py | 5 ++++- jose/jwt.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) 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