aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlddtree.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lddtree.py b/lddtree.py
index b65c3f2..e3dafda 100755
--- a/lddtree.py
+++ b/lddtree.py
@@ -589,8 +589,14 @@ def _ActionCopy(options, elf):
os.makedirs(os.path.dirname(dst), exist_ok=True)
try:
shutil.copy2(realsrc, dst)
+ except FileNotFoundError as e:
+ warn(f'{elf["path"]}: {e}')
+ return
except IOError:
- os.unlink(dst)
+ try:
+ os.unlink(dst)
+ except FileNotFoundError:
+ pass
shutil.copy2(realsrc, dst)
if wrapit: