From 17d5028145958b5bf5e582643e8542cac4f381e6 Mon Sep 17 00:00:00 2001 From: Lorenzo Conti Date: Thu, 16 May 2024 14:49:48 +0200 Subject: [PATCH] Reverted extension extraction to usage of pathlib --- src/rod/builder/primitives.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rod/builder/primitives.py b/src/rod/builder/primitives.py index aa196c1..b6bb883 100644 --- a/src/rod/builder/primitives.py +++ b/src/rod/builder/primitives.py @@ -77,9 +77,9 @@ def __post_init__(self) -> None: """ if isinstance(self.mesh_path, str): - extension = self.mesh_path.split(".")[-1] + extension = pathlib.Path(self.mesh_path).suffix elif isinstance(self.mesh_path, pathlib.Path): - extension = str(self.mesh_path).split(".")[-1] + extension = self.mesh_path.suffix else: raise TypeError( f"Expected str or pathlib.Path for mesh_path, got {type(self.mesh_path)}"