Skip to content

Commit e5b47a0

Browse files
committed
Fix FileNotFoundError: add existence check before copying test files
1 parent 4a71026 commit e5b47a0

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
@@ -57,7 +57,8 @@
5757
dst_path = os.path.join(dst_base, dst_rel_path)
5858

5959
# Copy the source directory to the destination
60-
if os.path.isdir(src_path):
61-
shutil.copytree(src_path, dst_path)
62-
else:
63-
shutil.copy2(src_path, dst_path)
60+
if os.path.exists(src_path):
61+
if os.path.isdir(src_path):
62+
shutil.copytree(src_path, dst_path)
63+
else:
64+
shutil.copy2(src_path, dst_path)

devinstall.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
dst_path = os.path.join(dst_base, dst_rel_path)
8585

8686
# Copy the source directory to the destination
87-
if os.path.isdir(src_path):
88-
shutil.copytree(src_path, dst_path)
89-
else:
90-
shutil.copy2(src_path, dst_path)
87+
if os.path.exists(src_path):
88+
if os.path.isdir(src_path):
89+
shutil.copytree(src_path, dst_path)
90+
else:
91+
shutil.copy2(src_path, dst_path)

0 commit comments

Comments
 (0)