def try_make_dirs(filename):
    try:
        dirname = os.path.dirname(os.path.normpath(filename))
        racedirs(dirname)
    except Exception as exc:
        sys.stderr.write('ERROR during log config file handling, could not create dirs for '
                         'filename `%s` because of: %s' % (filename, repr(exc)))
Tries to make directories for a given `filename`.
dataset/ETHPy150Open SmokinCaterpillar/pypet/pypet/pypetlogging.py/try_make_dirs