Skip to content

Commit 7d9e415

Browse files
committed
Avoid invoking the mv binary to move files
Just use shutil.move instead.
1 parent 5e8c9fd commit 7d9e415

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pycheribuild/filesystemutils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,15 @@ def async_clean_directory(
127127
all_entries_new.append(i)
128128
all_entries = all_entries_new
129129
all_entries = list(map(str, all_entries))
130-
if all_entries:
131-
run_command(["mv", *all_entries, str(tempdir)], print_verbose_only=True, config=self.config)
130+
print_command(["mv", *all_entries, str(tempdir)], print_verbose_only=True, config=self.config)
131+
for entry in all_entries:
132+
if not self.config.pretend:
133+
shutil.move(entry, tempdir)
132134
else:
133135
# rename the directory, create a new dir and then delete it in a background thread
134-
run_command("mv", path, tempdir, config=self.config)
136+
print_command("mv", path, tempdir, print_verbose_only=True, config=self.config)
137+
if not self.config.pretend:
138+
shutil.move(path, tempdir)
135139
self.makedirs(path)
136140
if not self.config.pretend:
137141
assert path.is_dir()

0 commit comments

Comments
 (0)