'Recursively create directories.'

def mkdir_p(self, path):

    try:
        os.makedirs(path)
    except OSError as exc:
        if ((exc.errno == errno.EEXIST) and os.path.isdir(path)):
            pass
        else:
            raise
