ifcopenshell.validate - fix Python 3.9 support (25eecde)

This commit is contained in:
Andrej
2025-05-29 17:48:10 +05:00
parent c23e973575
commit baf3edca13
@@ -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"