Skip to content

Commit

Permalink
style: add assertion to read_gltf's loaded type
Browse files Browse the repository at this point in the history
try to appease mypy type checking gods once again
  • Loading branch information
Olaf-Wolf3D committed May 8, 2024
1 parent 5a85c55 commit 00893ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/readyplayerme/meshops/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00893ce

Please sign in to comment.