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):
162
162
defines .extend (["DEBUG" , "TRACE" ])
163
163
164
164
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" )
169
167
170
168
# Check if --enable-shared was set when Python was built
171
169
enable_shared = sysconfig .get_config_var ("Py_ENABLE_SHARED" )
172
170
if enable_shared :
173
171
# 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 ])
175
174
if 'libpython' not in lddout :
176
175
enable_shared = False
177
176
You can’t perform that action at this time.
0 commit comments