Skip to content

Commit d350867

Browse files
authored
poncho: ignore same file error with hard links (#4230)
1 parent 90bbbe9 commit d350867

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

poncho/src/poncho/package_create.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ def _copy_run_in_env(env_dir):
9898
logger.error("could not find poncho_package_run. Please add it to the PATH.")
9999
sys.exit(1)
100100

101-
shutil.copy(candidate, f"{env_dir}/env/bin/poncho_package_run")
101+
try:
102+
shutil.copy(candidate, f"{env_dir}/env/bin/poncho_package_run")
103+
except shutil.SameFileError:
104+
# ndcctools already in env and conda using hard-links when possible
105+
pass
102106
with open(f"{env_dir}/env/bin/run_in_env", "w") as f:
103107
f.write("#! /bin/sh\n")
104108
f.write(

0 commit comments

Comments
 (0)