From 8de5de2354cbeae2e95d8bb8bf1f50d14a3f04fb Mon Sep 17 00:00:00 2001 From: Johan Medrano Date: Thu, 20 Mar 2025 08:46:16 -0400 Subject: [PATCH] [Fix] Check for Runtime in DYLD_FALLBACK... on Mac (fixes #32) --- spm/_spm/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spm/_spm/__init__.py b/spm/_spm/__init__.py index 902735f7c..13fcceb84 100644 --- a/spm/_spm/__init__.py +++ b/spm/_spm/__init__.py @@ -117,8 +117,14 @@ def get_paths_from_os(self): raise RuntimeError('Operating system {0} is not supported.'.format(self.system)) path_elements = [] + if self.path_var in os.environ: path_elements = os.environ[self.path_var].split(os.pathsep) + + # On the Mac, do an additional check on DYLD_FALLBACK_LIBRARY_PATH environment variable + if not path_elements and self.system == 'Darwin': + path_elements = os.environ['DYLD_FALLBACK_LIBRARY_PATH'].split(os.pathsep) + if not path_elements: if self.system == 'Darwin': raise RuntimeError('On the Mac, you must run mwpython rather than python ' +