diff --git a/src/ifcopenshell-python/ifcopenshell/validate.py b/src/ifcopenshell-python/ifcopenshell/validate.py index 01a0d61d36..7b90478583 100644 --- a/src/ifcopenshell-python/ifcopenshell/validate.py +++ b/src/ifcopenshell-python/ifcopenshell/validate.py @@ -53,6 +53,11 @@ from collections import namedtuple from typing import Union, Iterator, Any, Optional from logging import Logger, Handler +if sys.version_info >= (3, 10): + from types import EllipsisType +else: + EllipsisType = type(...) + import ifcopenshell import ifcopenshell.simple_spf import ifcopenshell.ifcopenshell_wrapper @@ -439,7 +444,7 @@ def validate(f: Union[ifcopenshell.file, str], logger: Logger, express_rules=Fal if hasattr(logger, "set_state"): logger.set_state("instance", inst) - guid: Union[str, None, types.EllipsisType] + guid: Union[str, None, EllipsisType] if (guid := getattr(inst, "GlobalId", ...)) is not ...: if guid is not None and guid in used_guids: rule = "Rule IfcRoot.UR1:\n The attribute GlobalId should be unique"