Skip to content

Commit

Permalink
Fix circular import between fs.base, fs.osfs and fs.move
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Mar 30, 2022
1 parent 78f6696 commit 46fbc71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import six

from . import copy, errors, fsencode, iotools, move, tools, walk, wildcard
from . import copy, errors, fsencode, iotools, tools, walk, wildcard
from .copy import copy_modified_time
from .glob import BoundGlobber
from .mode import validate_open_mode
Expand Down Expand Up @@ -1083,10 +1083,12 @@ def movedir(self, src_path, dst_path, create=False, preserve_time=False):
ancestors is not a directory.
"""
from .move import move_dir

with self._lock:
if not create and not self.exists(dst_path):
raise errors.ResourceNotFound(dst_path)
move.move_dir(self, src_path, self, dst_path, preserve_time=preserve_time)
move_dir(self, src_path, self, dst_path, preserve_time=preserve_time)

def makedirs(
self,
Expand Down

0 comments on commit 46fbc71

Please sign in to comment.