Skip to content

Commit f47cff5

Browse files
authored
[Bug] if dst not exists, when move a single file may raise a file not exist error. (#1803)
1 parent c886936 commit f47cff5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mmocr/datasets/preparers/obtainers/naive_data_obtainer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def move(self, mapping: List[Tuple[str, str]]) -> None:
191191
shutil.move(f, dst)
192192

193193
elif osp.exists(src) and not osp.exists(dst):
194+
mkdir_or_exist(osp.dirname(dst))
194195
shutil.move(src, dst)
195196

196197
def clean(self) -> None:

0 commit comments

Comments
 (0)