Skip to content

Commit 464a09b

Browse files
committed
Fix FileNotFoundError: add existence check before copying test files
1 parent 997e812 commit 464a09b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

devgetchanges.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
src_path = os.path.join(src_base, src_rel_path)
6060
dst_path = os.path.join(dst_base, dst_rel_path)
6161

62-
if os.path.isdir(src_path):
63-
shutil.copytree(src_path, dst_path)
64-
else:
65-
shutil.copy2(src_path, dst_path)
62+
if os.path.exists(src_path):
63+
if os.path.isdir(src_path):
64+
shutil.copytree(src_path, dst_path)
65+
else:
66+
shutil.copy2(src_path, dst_path)

devinstall.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
src_path = os.path.join(src_base, src_rel_path)
6464
dst_path = os.path.join(dst_base, dst_rel_path)
6565

66-
if os.path.isdir(src_path):
67-
shutil.copytree(src_path, dst_path)
68-
else:
69-
shutil.copy2(src_path, dst_path)
66+
if os.path.exists(src_path):
67+
if os.path.isdir(src_path):
68+
shutil.copytree(src_path, dst_path)
69+
else:
70+
shutil.copy2(src_path, dst_path)

0 commit comments

Comments
 (0)