diff --git a/src/ifcopenshell-python/ifcopenshell/geom/main.py b/src/ifcopenshell-python/ifcopenshell/geom/main.py index 677b52139e..99656ce69b 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/main.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/main.py @@ -33,13 +33,13 @@ def has_occ(): try: import OCC.Core.BRepTools return True - except ModuleNotFoundError: + except ImportError: pass try: import OCC.BRepTools return True - except ModuleNotFoundError: + except ImportError: pass return False @@ -57,7 +57,7 @@ if has_occ: try: from OCC.Core import TopoDS - except ModuleNotFoundError: + except ImportError: from OCC import TopoDS def wrap_shape_creation(settings, shape): return utils.create_shape_from_serialization(shape) if getattr(settings, diff --git a/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py b/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py index a702de9b44..8455d47732 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/occ_utils.py @@ -29,7 +29,7 @@ from collections import namedtuple, Iterable try: from OCC.Core import V3d, TopoDS, gp, AIS, Quantity, BRepTools, Graphic3d -except ModuleNotFoundError: +except ImportError: from OCC import V3d, TopoDS, gp, AIS, Quantity, BRepTools, Graphic3d shape_tuple = namedtuple('shape_tuple', ('data', 'geometry', 'styles'))