Skip to content

Commit

Permalink
fix(python): use Union over | for cast_image
Browse files Browse the repository at this point in the history
To address:

  ERROR test/test_compress_stringify.py - TypeError: unsupported operand type(s) for |: 'EnumMeta' and 'EnumMeta'

with Python 3.8.
  • Loading branch information
thewtex committed Aug 21, 2023
1 parent 05e5366 commit 6cabf37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/python/itkwasm/itkwasm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""itkwasm: Python interface to itk-wasm WebAssembly modules."""

__version__ = "1.0b128"
__version__ = "1.0b129"

from .interface_types import InterfaceTypes
from .image import Image, ImageType
Expand Down
4 changes: 2 additions & 2 deletions packages/core/python/itkwasm/itkwasm/cast_image.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Optional, Union
from dataclasses import asdict
import copy

Expand All @@ -11,7 +11,7 @@

def cast_image(input_image: Image,
pixel_type: Optional[PixelTypes]=None,
component_type: Optional[IntTypes | FloatTypes]=None) -> Image:
component_type: Optional[Union[IntTypes, FloatTypes]]=None) -> Image:
"""Cast an image to another pixel type and / or component type."""
output_image_type = ImageType(**asdict(input_image.imageType))

Expand Down

0 comments on commit 6cabf37

Please sign in to comment.