mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
ifcopenshell.open - readable error if file doesn't exist
Previously it would show obscure error like: RuntimeError: Type held at index 0 is class Blank and not class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >
This commit is contained in:
@@ -156,6 +156,8 @@ 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():
|
||||||
|
raise FileNotFoundError(f"File does not exist: '{path}'.")
|
||||||
if format is None:
|
if format is None:
|
||||||
format = guess_format(path)
|
format = guess_format(path)
|
||||||
if format == ".ifcXML":
|
if format == ".ifcXML":
|
||||||
|
|||||||
Reference in New Issue
Block a user