From 593789336f75861e7b22819ffe6d677beeeb119b Mon Sep 17 00:00:00 2001 From: Benjamin Auquite Date: Fri, 16 Feb 2024 04:19:52 -0600 Subject: [PATCH] suppress some annoying errors --- Tools/HolocronToolset/src/toolset/gui/windows/indoor_builder.py | 2 +- .../HolocronToolset/src/toolset/gui/windows/module_designer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/HolocronToolset/src/toolset/gui/windows/indoor_builder.py b/Tools/HolocronToolset/src/toolset/gui/windows/indoor_builder.py index 7e6b0b7f2..6d8df3ccc 100644 --- a/Tools/HolocronToolset/src/toolset/gui/windows/indoor_builder.py +++ b/Tools/HolocronToolset/src/toolset/gui/windows/indoor_builder.py @@ -1133,7 +1133,7 @@ def _downloadKit(self, kitId: str) -> bool: return False finally: try: - if tempdir: + if tempdir and Path(tempdir).safe_isdir(): shutil.rmtree(tempdir) except Exception as exc: # noqa: BLE001 print(format_exception_with_variables(exc)) diff --git a/Tools/HolocronToolset/src/toolset/gui/windows/module_designer.py b/Tools/HolocronToolset/src/toolset/gui/windows/module_designer.py index 37c59d10e..2564568c9 100644 --- a/Tools/HolocronToolset/src/toolset/gui/windows/module_designer.py +++ b/Tools/HolocronToolset/src/toolset/gui/windows/module_designer.py @@ -262,7 +262,7 @@ def openModule(self): [ bwm.resource() # FIXME: resource() will sometimes return None for bwm in self._module.resources.values() - if bwm.restype() == ResourceType.WOK + if bwm.restype() == ResourceType.WOK and bwm.resource() is not None ], ) self.ui.flatRenderer.centerCamera()