mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
ifcopenshell.validate - fix Python 3.9 support (25eecde)
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user