check for data directory existence for the sake of logging
This commit is contained in:
parent
5cfbbe7a99
commit
7f04419d4c
1 changed files with 4 additions and 3 deletions
|
@ -7,7 +7,7 @@ from urllib3 import disable_warnings
|
|||
from os import stat, remove, makedirs
|
||||
from urllib.request import urlretrieve
|
||||
from json.decoder import JSONDecodeError
|
||||
from os.path import abspath, join, basename
|
||||
from os.path import abspath, join, basename, isdir
|
||||
from urllib3.exceptions import InsecureRequestWarning
|
||||
from requests.exceptions import InvalidSchema, SSLError, ConnectionError
|
||||
|
||||
|
@ -108,6 +108,7 @@ def connection_handler(session, request, verify):
|
|||
def mkdir_p(path):
|
||||
templogger = getLogger('temp')
|
||||
try:
|
||||
if not isdir(path):
|
||||
templogger.info('Creating folder %s ', path)
|
||||
makedirs(path, exist_ok=True)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Reference in a new issue