File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -162,16 +162,15 @@ def build_extension(self, ext):
162162 defines .extend (["DEBUG" , "TRACE" ])
163163
164164 if sys .platform != "win32" and DEVTOOLS == "Mono" :
165- if sys .platform == "darwin" :
166- defines .append ("MONO_OSX" )
167- else :
168- defines .append ("MONO_LINUX" )
165+ on_darwin = sys .platform == "darwin"
166+ defines .append ("MONO_OSX" if on_darwin else "MONO_LINUX" )
169167
170168 # Check if --enable-shared was set when Python was built
171169 enable_shared = sysconfig .get_config_var ("Py_ENABLE_SHARED" )
172170 if enable_shared :
173171 # Double-check if libpython is linked dynamically with python
174- lddout = _check_output (["ldd" , sys .executable ])
172+ ldd_cmd = ["otool" , "-L" ] if on_darwin else ["ldd" ]
173+ lddout = _check_output (ldd_cmd + [sys .executable ])
175174 if 'libpython' not in lddout :
176175 enable_shared = False
177176
You can’t perform that action at this time.
0 commit comments