From 3fde58f1e06bf7f966ed52712d1bf8929282be41 Mon Sep 17 00:00:00 2001 From: nbrunett Date: Tue, 15 Feb 2022 13:55:09 -0500 Subject: [PATCH] add try-except clause for importing Iterable pre/post Python 3.9 --- astrodendro/dendrogram.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/astrodendro/dendrogram.py b/astrodendro/dendrogram.py index 42750f7..72cfeeb 100644 --- a/astrodendro/dendrogram.py +++ b/astrodendro/dendrogram.py @@ -5,7 +5,12 @@ # - An ancestor is the largest structure that a structure is part of import numpy as np -from collections import Iterable +try: + # Python <= 3.9 + from collections import Iterable +except ImportError: + # Python > 3.9 + from collections.abc import Iterable import copy import warnings