From 119821c20c38a4ad77ccd6d229e5141c4850ad45 Mon Sep 17 00:00:00 2001 From: Ralf Schlatterbeck Date: Fri, 28 Jul 2023 12:29:23 +0200 Subject: [PATCH] Fix import: Iterable is in collections.abc .. in newer versions of python3. --- smithplot/smithaxes.py | 5 ++++- smithplot/smithhelper.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/smithplot/smithaxes.py b/smithplot/smithaxes.py index 2ed8cbb..3fe6ea3 100644 --- a/smithplot/smithaxes.py +++ b/smithplot/smithaxes.py @@ -36,7 +36,10 @@ parameters are array-like types (e.g. numpy.ndarray). ''' -from collections import Iterable +try: + from collections.abc import Iterable +except ImportError: + from collections import Iterable from numbers import Number from types import MethodType, FunctionType diff --git a/smithplot/smithhelper.py b/smithplot/smithhelper.py index cba2199..7b5c285 100644 --- a/smithplot/smithhelper.py +++ b/smithplot/smithhelper.py @@ -1,7 +1,10 @@ # -*- coding: utf-8 -*- # last edit: 11.04.2018 -from collections import Iterable +try: + from collections.abc import Iterable +except ImportError: + from collections import Iterable import numpy as np