From d0d6e937582d673d7b319ff9f26d55a39c3b6b7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 4 Feb 2020 14:15:35 +0100
Subject: [PATCH] Fix import of collections.abc.Iterable
Required for python3.9 compatibility.
---
conda/_vendor/auxlib/compat.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/conda/_vendor/auxlib/compat.py b/conda/_vendor/auxlib/compat.py
index 2cd720e0e5..efb4c111bf 100644
--- a/conda/_vendor/auxlib/compat.py
+++ b/conda/_vendor/auxlib/compat.py
@@ -2,7 +2,6 @@
from __future__ import absolute_import, division, print_function
import codecs
-import collections
from itertools import chain
import os
import sys
@@ -17,6 +16,11 @@ from shlex import split
from functools import partial
from tempfile import NamedTemporaryFile, template
+try:
+ from collections.abc import Iterable # NOQA
+except ImportError:
+ from collections import Iterable # NOQA
+
try:
from collections import OrderedDict as odict # NOQA
except ImportError:
@@ -34,7 +38,7 @@ def isiterable(obj):
and not isinstance(obj, string_types)
and type(obj) is not type)
else:
- return not isinstance(obj, string_types) and isinstance(obj, collections.Iterable)
+ return not isinstance(obj, string_types) and isinstance(obj, Iterable)
# shlex.split() is a poor function to use for anything general purpose (like calling subprocess).