File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -181,17 +181,19 @@ def build_extension(self, ext):
181
181
target_dir )
182
182
else :
183
183
if sys .platform == "win32" :
184
- wildcard_so = "*. dll"
184
+ dylib_ext = "dll"
185
185
elif sys .platform == "darwin" :
186
- wildcard_so = "*. dylib"
186
+ dylib_ext = "dylib"
187
187
else :
188
- wildcard_so = "*.so"
188
+ dylib_ext = "so"
189
+ wildcard_so = "*{}.{}" .format (ext .basename , dylib_ext )
189
190
190
191
try :
191
- dylib_paths .append (
192
- (ext .name , glob .glob (
193
- os .path .join (artifactsdir , wildcard_so ))[0 ]))
194
- except IndexError :
192
+ dylib_paths .append ((
193
+ ext .name ,
194
+ next (glob .iglob (os .path .join (artifactsdir , wildcard_so )))
195
+ ))
196
+ except StopIteration :
195
197
raise DistutilsExecError (
196
198
"rust build failed; unable to find any %s in %s" %
197
199
(wildcard_so , artifactsdir ))
You can’t perform that action at this time.
0 commit comments