From 0b6d321d83961b693f1798c72762ed0bc72321d4 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 26 Jan 2023 11:09:51 +1100 Subject: [PATCH] Fix #2721. --- src/blenderbim/blenderbim/bim/ifc.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/ifc.py b/src/blenderbim/blenderbim/bim/ifc.py index b83287a98a..68506bb125 100644 --- a/src/blenderbim/blenderbim/bim/ifc.py +++ b/src/blenderbim/blenderbim/bim/ifc.py @@ -96,10 +96,13 @@ class IfcStore: try: IfcStore.cache = ifcopenshell.geom.serializers.hdf5(IfcStore.cache_path, cache_settings) except: - os.remove(IfcStore.cache_path) - try: - IfcStore.cache = ifcopenshell.geom.serializers.hdf5(IfcStore.cache_path, cache_settings) - except: + if os.path.exists(IfcStore.cache_path): + os.remove(IfcStore.cache_path) + try: + IfcStore.cache = ifcopenshell.geom.serializers.hdf5(IfcStore.cache_path, cache_settings) + except: + return + else: return return IfcStore.cache