fix: only get path once

This commit is contained in:
ljnsn 2025-05-09 02:16:03 +02:00
parent 361b99a265
commit 28060e8f25
No known key found for this signature in database
GPG Key ID: 56FA44C04555E6DD
1 changed files with 3 additions and 3 deletions

View File

@ -37,11 +37,11 @@ def read_ods(
"""
path = file_or_path if isinstance(file_or_path, Path) else Path(file_or_path)
if not path.is_file():
raise FileNotFoundError(f"file {file_or_path} does not exist")
backend = EXT_MAP.get(Path(file_or_path).suffix, ods)
raise FileNotFoundError(f"file {path} does not exist")
backend = EXT_MAP.get(path.suffix, ods)
return algo.read_data(
backend,
Path(file_or_path),
path,
sheet,
headers=headers,
columns=columns or [],