From baf3edca138317faba3051d23b3f552d9d984736 Mon Sep 17 00:00:00 2001 From: Andrej Date: Thu, 29 May 2025 17:48:10 +0500 Subject: [PATCH] ifcopenshell.validate - fix Python 3.9 support (25eecde) --- src/ifcopenshell-python/ifcopenshell/validate.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"