diff --git a/src/ifcblenderexport/occ_utils.py b/src/ifcblenderexport/occ_utils.py index 6087caa3bc..bdbe29ae82 100755 --- a/src/ifcblenderexport/occ_utils.py +++ b/src/ifcblenderexport/occ_utils.py @@ -25,7 +25,11 @@ import random import operator import warnings -from collections import namedtuple, Iterable +from collections import namedtuple +try: # python 3.3+ + from collections.abc import Iterable +except ModuleNotFoundError: # python 2 + from collections import Iterable try: from OCC.Core import TopoDS, gp, Quantity, BRepTools diff --git a/src/ifcopenshell-python/ifcopenshell/geom/app.py b/src/ifcopenshell-python/ifcopenshell/geom/app.py index 16bfdb8349..308025b4ce 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/app.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/app.py @@ -11,7 +11,11 @@ import multiprocessing import OCC.AIS -from collections import defaultdict, Iterable, OrderedDict +from collections import defaultdict, OrderedDict +try: # python 3.3+ + from collections.abc import Iterable +except ModuleNotFoundError: # python 2 + from collections import Iterable try: QString = unicode diff --git a/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py b/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py index 32d0f7bf98..ec77ea7340 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py @@ -25,7 +25,11 @@ import random import operator import warnings -from collections import namedtuple, Iterable +from collections import namedtuple +try: # python 3.3+ + from collections.abc import Iterable +except ModuleNotFoundError: # python 2 + from collections import Iterable try: from OCC.Core import V3d, TopoDS, gp, AIS, Quantity, BRepTools, Graphic3d