Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import ABC from collections.abc instead of collections for Python 3 compatibility #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion jose/jws.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion jose/jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down