diff --git a/flask_restplus/api.py b/flask_restplus/api.py index b5433ce3..cd61106f 100644 --- a/flask_restplus/api.py +++ b/flask_restplus/api.py @@ -10,11 +10,7 @@ import six import sys -try: - from collections.abc import OrderedDict -except ImportError: - # TODO Remove this to drop Python2 support - from collections import OrderedDict +from collections import OrderedDict from functools import wraps, partial from types import MethodType diff --git a/flask_restplus/marshalling.py b/flask_restplus/marshalling.py index 84c8feb2..5284fb14 100644 --- a/flask_restplus/marshalling.py +++ b/flask_restplus/marshalling.py @@ -1,11 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -try: - from collections.abc import OrderedDict -except ImportError: - # TODO Remove this to drop Python2 support - from collections import OrderedDict +from collections import OrderedDict from functools import wraps from six import iteritems diff --git a/flask_restplus/mask.py b/flask_restplus/mask.py index ee61669d..e4c1670c 100644 --- a/flask_restplus/mask.py +++ b/flask_restplus/mask.py @@ -5,11 +5,7 @@ import re import six -try: - from collections.abc import OrderedDict -except ImportError: - # TODO Remove this to drop Python2 support - from collections import OrderedDict +from collections import OrderedDict from inspect import isclass from .errors import RestError diff --git a/flask_restplus/model.py b/flask_restplus/model.py index cbe1a3cf..efaa4692 100644 --- a/flask_restplus/model.py +++ b/flask_restplus/model.py @@ -6,10 +6,11 @@ import warnings try: - from collections.abc import OrderedDict, MutableMapping + from collections.abc import MutableMapping except ImportError: # TODO Remove this to drop Python2 support - from collections import OrderedDict, MutableMapping + from collections import MutableMapping +from collections import OrderedDict from six import iteritems, itervalues from werkzeug.utils import cached_property diff --git a/flask_restplus/swagger.py b/flask_restplus/swagger.py index 7c534b26..1d4ca973 100644 --- a/flask_restplus/swagger.py +++ b/flask_restplus/swagger.py @@ -6,10 +6,11 @@ from inspect import isclass, getdoc try: - from collections.abc import OrderedDict, Hashable + from collections.abc import Hashable except ImportError: # TODO Remove this to drop Python2 support - from collections import OrderedDict, Hashable + from collections import Hashable +from collections import OrderedDict from six import string_types, itervalues, iteritems, iterkeys from flask import current_app diff --git a/flask_restplus/utils.py b/flask_restplus/utils.py index a094d2dd..9ec17721 100644 --- a/flask_restplus/utils.py +++ b/flask_restplus/utils.py @@ -3,11 +3,7 @@ import re -try: - from collections.abc import OrderedDict -except ImportError: - # TODO Remove this to drop Python2 support - from collections import OrderedDict +from collections import OrderedDict from copy import deepcopy from six import iteritems diff --git a/tests/test_fields.py b/tests/test_fields.py index 837e607d..fbc156f0 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -1,11 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -try: - from collections.abc import OrderedDict -except ImportError: - # TODO Remove this to drop Python2 support - from collections import OrderedDict +from collections import OrderedDict from datetime import date, datetime from decimal import Decimal from functools import partial diff --git a/tests/test_fields_mask.py b/tests/test_fields_mask.py index 7ffeefc8..6328ae8e 100644 --- a/tests/test_fields_mask.py +++ b/tests/test_fields_mask.py @@ -4,11 +4,7 @@ import json import pytest -try: - from collections.abc import OrderedDict -except ImportError: - # TODO Remove this to drop Python2 support - from collections import OrderedDict +from collections import OrderedDict from flask_restplus import mask, Api, Resource, fields, marshal, Mask diff --git a/tests/test_marshalling.py b/tests/test_marshalling.py index 0698c071..2e0ac6f8 100644 --- a/tests/test_marshalling.py +++ b/tests/test_marshalling.py @@ -7,11 +7,7 @@ marshal, marshal_with, marshal_with_field, fields, Api, Resource ) -try: - from collections.abc import OrderedDict -except ImportError: - # TODO Remove this to drop Python2 support - from collections import OrderedDict +from collections import OrderedDict # Add a dummy Resource to verify that the app is properly set. diff --git a/tests/test_model.py b/tests/test_model.py index 677232e0..483a8c6f 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -4,11 +4,7 @@ import copy import pytest -try: - from collections.abc import OrderedDict -except ImportError: - # TODO Remove this to drop Python2 support - from collections import OrderedDict +from collections import OrderedDict from flask_restplus import fields, Model, OrderedModel, SchemaModel