|
1 | 1 | """Functions for moving files between filesystems. |
2 | 2 | """ |
3 | 3 |
|
4 | | -from __future__ import print_function |
5 | | -from __future__ import unicode_literals |
| 4 | +from __future__ import print_function, unicode_literals |
6 | 5 |
|
7 | | -from os.path import commonpath |
8 | 6 | import typing |
9 | 7 |
|
10 | 8 | from . import open_fs |
11 | | -from .copy import copy_dir |
12 | | -from .copy import copy_file |
| 9 | +from ._pathcompat import commonpath |
| 10 | +from .copy import copy_dir, copy_file |
13 | 11 | from .errors import FSError |
14 | 12 | from .opener import manage_fs |
15 | 13 | from .path import frombase |
16 | 14 |
|
17 | 15 | if typing.TYPE_CHECKING: |
18 | | - from .base import FS |
19 | 16 | from typing import Text, Union |
20 | 17 |
|
| 18 | + from .base import FS |
| 19 | + |
21 | 20 |
|
22 | 21 | def move_fs( |
23 | 22 | src_fs, # type: Union[Text, FS] |
@@ -80,7 +79,7 @@ def move_file( |
80 | 79 | with _src_fs.lock(), _dst_fs.lock(): |
81 | 80 | with open_fs(common, writeable=True) as base: |
82 | 81 | base.move(rel_src, rel_dst, preserve_time=preserve_time) |
83 | | - return # optimization worked, exit early |
| 82 | + return # optimization worked, exit early |
84 | 83 | except ValueError: |
85 | 84 | # This is raised if we cannot find a common base folder. |
86 | 85 | # In this case just fall through to the standard method. |
|
0 commit comments