From: Daid Date: Thu, 27 Jun 2013 09:36:46 +0000 (+0200) Subject: Implement a fallback if the Foundation import fails. Stupid MacOS. X-Git-Tag: 13.10~131 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=cadbb656c252e7adb112d1b0ab376430afdbb22c;p=cura.git Implement a fallback if the Foundation import fails. Stupid MacOS. --- 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: