Skip to content

Commit 62e0efa

Browse files
committed
-Add failure case for old import style
1 parent 030486b commit 62e0efa

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

flask_restplus/reqparse.py

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

7-
from collections.abc import Hashable
7+
try:
8+
from collections.abc import Hashable
9+
except ImportError:
10+
from collections import Hashable
811
from copy import deepcopy
912
from flask import current_app, request
1013

flask_restplus/swagger.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
from inspect import isclass, getdoc
88
from collections import OrderedDict
9-
from collections.abc import Hashable
9+
try:
10+
from collections.abc import Hashable
11+
except ImportError:
12+
from collections import Hashable
1013
from six import string_types, itervalues, iteritems, iterkeys
1114

1215
from flask import current_app

0 commit comments

Comments
 (0)