mirror of
https://github.com/k2-fsa/sherpa-onnx.git
synced 2026-11-10 21:11:03 +08:00
Fix Python tests for Windows (#4135)
This commit is contained in:
1 parent
f04a8f77f1
commit
a7423b6cd5
1 file changed
+6
-1
@@ -345,6 +345,11 @@ class BuildExtension(build_ext):
|
||||
|
||||
binaries = get_binaries()
|
||||
|
||||
# setup.py creates this directory only when it also installs binaries,
|
||||
# i.e., not when SHERPA_ONNX_ENABLE_BINARY=OFF. The DLLs below are
|
||||
# copied regardless, so make sure the destination exists.
|
||||
os.makedirs(out_bin_dir, exist_ok=True)
|
||||
|
||||
for f in binaries:
|
||||
suffix = "" if ".dll" in f else suffix
|
||||
src_file = install_dir / "bin" / (f + suffix)
|
||||
@@ -357,7 +362,7 @@ class BuildExtension(build_ext):
|
||||
continue
|
||||
|
||||
print(f"Copying {src_file} to {out_bin_dir}/")
|
||||
shutil.copy(f"{src_file}", f"{out_bin_dir}/")
|
||||
shutil.copy(f"{src_file}", f"{out_bin_dir}")
|
||||
|
||||
if Path(f"{install_dir}/bin").is_dir():
|
||||
shutil.rmtree(f"{install_dir}/bin")
|
||||
|
||||
Reference in new issue
Block a user