Skip to content

Commit 70ff8da

Browse files
committed
Fix FileNotFoundError: add existence check before copying test files
1 parent 97f173b commit 70ff8da

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
@@ -67,7 +67,8 @@
6767
src_path = os.path.join(src_base, src_rel_path)
6868
dst_path = os.path.join(dst_base, dst_rel_path)
6969

70-
if os.path.isdir(src_path):
71-
shutil.copytree(src_path, dst_path)
72-
else:
73-
shutil.copy2(src_path, dst_path)
70+
if os.path.exists(src_path):
71+
if os.path.isdir(src_path):
72+
shutil.copytree(src_path, dst_path)
73+
else:
74+
shutil.copy2(src_path, dst_path)

0 commit comments

Comments
 (0)