From b24d0dbca494fe8e656a9df1680c9ffb3d6d3950 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Fri, 15 Nov 2024 20:17:50 +0100 Subject: [PATCH] cross-platform acrobatics --- bimport.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bimport.py b/bimport.py index a1c88b7..2ec6f58 100644 --- a/bimport.py +++ b/bimport.py @@ -424,7 +424,13 @@ class ImportGLTF2(Operator, ConvertGLTF2_Base, ImportHelper): elapsed_s = "{:.2f}s".format(time.time() - start_time) print("font import gltf finished in " + elapsed_s) - gltf.log.removeHandler(gltf.log_handler) + # acrobatics to not break on MacOS + if hasattr(gltf, "log_handler"): + if hasattr(gltf.log, "removeHandler"): + gltf.log.removeHandler(gltf.log_handler) + elif hasattr(gltf.log, "logger"): + if hasattr(gltf.log.logger, "removeHandler"): + gltf.log.logger.removeHandler(gltf.log_handler) return {'FINISHED'}