From cadbb656c252e7adb112d1b0ab376430afdbb22c Mon Sep 17 00:00:00 2001 From: Daid Date: Thu, 27 Jun 2013 11:36:46 +0200 Subject: [PATCH] Implement a fallback if the Foundation import fails. Stupid MacOS. --- Cura/util/resources.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Cura/util/resources.py b/Cura/util/resources.py index 1dad2ade..ad1e5ebc 100644 --- a/Cura/util/resources.py +++ b/Cura/util/resources.py @@ -9,8 +9,12 @@ __all__ = ['getPathForResource', 'getPathForImage', 'getPathForMesh'] if sys.platform.startswith('darwin'): if hasattr(sys, 'frozen'): - from Foundation import * - resourceBasePath = NSBundle.mainBundle().resourcePath() + try: + #Foundation import can crash on some MacOS installs + from Foundation import * + resourceBasePath = NSBundle.mainBundle().resourcePath() + except: + resourceBasePath = os.path.join(os.path.dirname(__file__), "../../../../../") else: resourceBasePath = os.path.join(os.path.dirname(__file__), "../resources") else: -- 2.30.2