From 00893ce4e408e27388687a00134fe95dfca02d8a Mon Sep 17 00:00:00 2001 From: Olaf Haag Date: Wed, 8 May 2024 15:59:35 +0200 Subject: [PATCH] style: add assertion to read_gltf's `loaded` type try to appease mypy type checking gods once again --- src/readyplayerme/meshops/mesh.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/readyplayerme/meshops/mesh.py b/src/readyplayerme/meshops/mesh.py index bd3ad30..7861d08 100644 --- a/src/readyplayerme/meshops/mesh.py +++ b/src/readyplayerme/meshops/mesh.py @@ -52,7 +52,8 @@ def read_gltf(filename: str | Path) -> Mesh: :return: The loaded mesh object. """ try: - loaded: trimesh.Trimesh = trimesh.load(filename, process=False, force="mesh") + loaded = trimesh.load(filename, process=False, force="mesh") + assert isinstance(loaded, trimesh.Trimesh), "Loaded object is not a Trimesh." # noqa: S101 # For type checker. except ValueError as error: msg = f"Error loading {filename}: {error}" raise OSError(msg) from error