|
6 | 6 | import glob |
7 | 7 | import json |
8 | 8 | from logging import getLogger |
| 9 | +import os |
9 | 10 | from os.path import join, exists, dirname, split |
10 | 11 | from os import remove |
11 | 12 | from shutil import copy |
|
18 | 19 | from loris import constants |
19 | 20 | from loris.identifiers import CacheNamer, IdentRegexChecker |
20 | 21 | from loris.loris_exception import ResolverException, ConfigError |
21 | | -from loris.utils import mkdir_p, safe_rename |
| 22 | +from loris.utils import safe_rename |
22 | 23 | from loris.img_info import ImageInfo |
23 | 24 |
|
24 | 25 |
|
@@ -314,7 +315,7 @@ def copy_to_cache(self, ident): |
314 | 315 | assert source_url is not None |
315 | 316 |
|
316 | 317 | cache_dir = self.cache_dir_path(ident) |
317 | | - mkdir_p(cache_dir) |
| 318 | + os.makedirs(cache_dir, exist_ok=True) |
318 | 319 |
|
319 | 320 | with closing(requests.get(source_url, stream=True, **options)) as response: |
320 | 321 | if not response.ok: |
@@ -531,7 +532,7 @@ def copy_to_cache(self, ident): |
531 | 532 | source_fp = self.source_file_path(ident) |
532 | 533 | cache_fp = self.cache_file_path(ident) |
533 | 534 |
|
534 | | - mkdir_p(dirname(cache_fp)) |
| 535 | + os.makedirs(dirname(cache_fp), exist_ok=True) |
535 | 536 | copy(source_fp, cache_fp) |
536 | 537 | logger.info("Copied %s to %s", source_fp, cache_fp) |
537 | 538 |
|
|
0 commit comments