Skip to content

Commit

Permalink
BUG: Replace ModuleNotFoundError with ImportError
Browse files Browse the repository at this point in the history
ModuleNotFoundError is not available in Python 3.5
  • Loading branch information
thewtex committed Jan 8, 2020
1 parent 534061f commit 558e16a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions itkwidgets/_transform_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def to_itk_image(image_like):
def to_point_set(point_set_like): # noqa: C901
if isinstance(point_set_like, itk.PointSet):
if not hasattr(itk, 'PyVectorContainer'):
raise ModuleNotFoundError(
raise ImportError(
'itk.MeshToPolyDataFilter is not available -- install the itk-meshtopolydata package')
itk_polydata = itk.mesh_to_poly_data_filter(point_set_like)

Expand Down Expand Up @@ -289,7 +289,7 @@ def to_point_set(point_set_like): # noqa: C901
def to_geometry(geometry_like): # noqa: C901
if isinstance(geometry_like, itk.Mesh):
if not hasattr(itk, 'PyVectorContainer'):
raise ModuleNotFoundError(
raise ImportError(
'itk.MeshToPolyDataFilter is not available -- install the itk-meshtopolydata package')
itk_polydata = itk.mesh_to_poly_data_filter(geometry_like)

Expand Down

0 comments on commit 558e16a

Please sign in to comment.