Skip to content

Commit aac4c32

Browse files
authored
Merge pull request #124 from peteryin21/import_from_collection_abc
Address collections.abc import warning introduced in Python 3.7
2 parents 03707b1 + 700552a commit aac4c32

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

jose/jws.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
import json
44
import six
55

6-
from collections import Mapping, Iterable
6+
try:
7+
from collections.abc import Mapping, Iterable # Python 3
8+
except ImportError:
9+
from collections import Mapping, Iterable # Python 2, will be deprecated in Python 3.8
710

811
from jose import jwk
912
from jose.constants import ALGORITHMS

jose/jwt.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
import json
33

44
from calendar import timegm
5-
from collections import Mapping
5+
try:
6+
from collections.abc import Mapping # Python3
7+
except ImportError:
8+
from collections import Mapping # Python2, will be depecrated in Python 3.8
69
from datetime import datetime
710
from datetime import timedelta
811
from six import string_types

requirements-dev.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
PyYAML==3.11
22
cov-core==1.15.0
3-
coverage==3.7.1
4-
coveralls==0.5
3+
coverage==4.4
4+
coveralls==1.5.1
5+
cryptography==2.4.2
56
docopt==0.6.2
67
nose==1.3.6
7-
py==1.4.26
8-
pytest==2.7.0
9-
pytest-cov==1.8.1
10-
ecdsa==0.13
11-
wsgiref==0.1.2
12-
8+
py==1.5.4
9+
pytest==4.1.1
10+
pytest-cov==2.6.1
11+
# wsgiref is included in python standard library in Python 3, and will fail to install.
12+
wsgiref==0.1.2; python_version < "3.0"
1313
-r requirements.txt
1414
-r requirements-rtd.txt

0 commit comments

Comments
 (0)