Commit 3a5b8bb
committed
Avoid DeprecationWarning when importing OrderedDict
in flask_restx/model.py and flask_restx/swagger.py logic is installed to
circumvent differences in Python2 and Python3 when importing from the
collections module. Some classes from collections has been moved to
collections.abc in Python3. OrderedDict is not one of them, hence an
ImportError is raised when trying to import OrderedDict from
collections.abc. This then leads to importing both OrderedDict AND
MutableMapping/Hashable from collections.abc which then raises a
deprecation warning since MutableMapping/Hashable lives in
collections.abc in Python3.
This patch should fix those DeprecationWarnings to be raised.1 parent ae9aa33 commit 3a5b8bb
2 files changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments