Skip to content

Commit

Permalink
simpler recreation code
Browse files Browse the repository at this point in the history
  • Loading branch information
tfeldmann committed Aug 30, 2022
1 parent e6011ca commit 3ad30a2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/move.py
Expand Up @@ -162,8 +162,7 @@ def move_dir(
with convert_os_errors("move_dir", dst_path, directory=True):
os.rename(src_syspath, dst_syspath)
# recreate the root dir if it has been renamed
if src_path == "/" and not _src_fs.exists("/"):
_src_fs.makedir("/")
_src_fs.makedir("/", recreate=True)
return # optimization worked, exit early

# standard copy then delete
Expand Down

0 comments on commit 3ad30a2

Please sign in to comment.