mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 14:33:28 +00:00
Fix #4996. Don't use assert_never to support Python 3.10.
This commit is contained in:
@@ -39,7 +39,7 @@ from blenderbim.bim.module.model.data import AuthoringData
|
|||||||
from mathutils import Vector, Matrix
|
from mathutils import Vector, Matrix
|
||||||
from bpy_extras.object_utils import AddObjectHelper
|
from bpy_extras.object_utils import AddObjectHelper
|
||||||
import json
|
import json
|
||||||
from typing import Any, Union, Optional, assert_never
|
from typing import Any, Union, Optional
|
||||||
|
|
||||||
|
|
||||||
class EnableAddType(bpy.types.Operator, tool.Ifc.Operator):
|
class EnableAddType(bpy.types.Operator, tool.Ifc.Operator):
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import blenderbim.bim.helper
|
|||||||
import ifcopenshell.util.unit
|
import ifcopenshell.util.unit
|
||||||
import ifcopenshell.util.element
|
import ifcopenshell.util.element
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from typing import Union, Any, TYPE_CHECKING, Optional, assert_never
|
from typing import Union, Any, TYPE_CHECKING, Optional
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
# Avoid circular imports.
|
# Avoid circular imports.
|
||||||
@@ -341,7 +341,7 @@ class Material(blenderbim.core.tool.Material):
|
|||||||
elif material_type == "IfcMaterialList":
|
elif material_type == "IfcMaterialList":
|
||||||
assert False, "Current assign_material implementation requires 'material' argument for IfcMaterialList."
|
assert False, "Current assign_material implementation requires 'material' argument for IfcMaterialList."
|
||||||
else:
|
else:
|
||||||
assert_never(material_type)
|
assert False, f"Invalid material type found: {material_type}"
|
||||||
|
|
||||||
for element in elements[:]:
|
for element in elements[:]:
|
||||||
if element.is_a("IfcElementType"):
|
if element.is_a("IfcElementType"):
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import blenderbim.core.tool
|
|||||||
import blenderbim.tool as tool
|
import blenderbim.tool as tool
|
||||||
import blenderbim.bim.helper
|
import blenderbim.bim.helper
|
||||||
from mathutils import Color
|
from mathutils import Color
|
||||||
from typing import Union, Any, Optional, Literal, assert_never
|
from typing import Union, Any, Optional, Literal
|
||||||
|
|
||||||
# fmt: off
|
# fmt: off
|
||||||
TEXTURE_MAPS_BY_METHODS = {
|
TEXTURE_MAPS_BY_METHODS = {
|
||||||
@@ -662,7 +662,7 @@ class Style(blenderbim.core.tool.Style):
|
|||||||
if rendering_style and texture_style:
|
if rendering_style and texture_style:
|
||||||
tool.Loader.create_surface_style_with_textures(blender_material, rendering_style, texture_style)
|
tool.Loader.create_surface_style_with_textures(blender_material, rendering_style, texture_style)
|
||||||
else:
|
else:
|
||||||
assert_never(style_type)
|
assert False, f"Invalid style type found: {style_type}"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def rename_style(cls, style: ifcopenshell.entity_instance, name: str) -> None:
|
def rename_style(cls, style: ifcopenshell.entity_instance, name: str) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user