diff --git a/kombu/utils/functional.py b/kombu/utils/functional.py index 252b757e..63395a39 100644 --- a/kombu/utils/functional.py +++ b/kombu/utils/functional.py @@ -5,7 +5,13 @@ import random import sys import threading -from collections import Iterable, Mapping, OrderedDict +from collections import OrderedDict + +try: + from collections.abc import Iterable, Mapping +except ImportError: + from collections import Iterable, Mapping + from itertools import count, repeat from time import sleep, time diff --git a/kombu/utils/url.py b/kombu/utils/url.py index fbc90a14..b86f2f6f 100644 --- a/kombu/utils/url.py +++ b/kombu/utils/url.py @@ -1,7 +1,11 @@ """URL Utilities.""" from __future__ import absolute_import, unicode_literals -from collections import Mapping +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping + from functools import partial try: diff --git a/t/unit/transport/test_qpid.py b/t/unit/transport/test_qpid.py index 5ca4f38a..ae2de8ba 100644 --- a/t/unit/transport/test_qpid.py +++ b/t/unit/transport/test_qpid.py @@ -8,7 +8,13 @@ import sys import time import uuid -from collections import Callable, OrderedDict +from collections import OrderedDict + +try: + from collections.abc import Callable +except ImportError: + from collections import Callable + from itertools import count from case import Mock, call, patch, skip