from pathlib import Path


def make_pathlib(path):
    """
    Make an pathlib.PosixPath object from path argument
    :param path: str or pathlib.PosixPath object
    :return: pathlib.PosixPath object
    """
    if isinstance(path, Path):
        f_path = path
    else:
        if not isinstance(path, str):
            raise TypeError("'path' needs to be an pathlib.PosixPath or str object")
        else:
            f_path = Path(path)
    return f_path