Skip to content

Commit 7ad29b6

Browse files
committed
Do not symlink on Windows
1 parent 6506112 commit 7ad29b6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

build_env.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,12 @@ def install_data_file(env_path: pathlib.Path, file: EnvFile) -> None:
144144

145145
def install_site_file(site_packages_path: pathlib.Path, file: EnvFile) -> None:
146146
site_path = site_packages_path / file.site_packages_path
147-
if not site_path.exists():
147+
if not site_path.exists() and file.path.exists():
148148
site_path.parent.mkdir(parents=True, exist_ok=True)
149-
site_path.symlink_to(file.path.resolve())
149+
try:
150+
site_path.symlink_to(file.path.resolve())
151+
except OSError:
152+
site_path.write_bytes(file.path.read_bytes())
150153

151154

152155
def install_files(env_path: pathlib.Path, files: List[EnvFile]) -> None:

0 commit comments

Comments
 (0)