Skip to content

Commit dc90a20

Browse files
authored
Merge pull request #249 from jakirkham/dirsto_use_renames
Use `os.renames` in `DirectoryStore`'s `rename`
2 parents 3c8e929 + f51d364 commit dc90a20

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

zarr/storage.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -841,10 +841,7 @@ def rename(self, src_path, dst_path):
841841
src_path = os.path.join(dir_path, store_src_path)
842842
dst_path = os.path.join(dir_path, store_dst_path)
843843

844-
dst_dir = os.path.dirname(dst_path)
845-
if not os.path.exists(dst_dir):
846-
os.makedirs(dst_dir)
847-
os.rename(src_path, dst_path)
844+
os.renames(src_path, dst_path)
848845

849846
def rmdir(self, path=None):
850847
store_path = normalize_storage_path(path)

0 commit comments

Comments
 (0)