ifcopenshell.open - more robust file existence check

This commit is contained in:
Andrej730
2024-12-23 16:19:45 +05:00
parent 6b0b7989b0
commit f1080a8278
@@ -158,7 +158,7 @@ def open(
print(products[0] == model[122] == model["2XQ$n5SLP5MBLyL442paFx"]) # True print(products[0] == model[122] == model["2XQ$n5SLP5MBLyL442paFx"]) # True
""" """
path = Path(path) path = Path(path)
if not path.exists(): if not path.is_file():
raise FileNotFoundError(f"File does not exist: '{path}'.") raise FileNotFoundError(f"File does not exist: '{path}'.")
if format is None: if format is None:
format = guess_format(path) format = guess_format(path)