def path_to_str(path):
    """ Convert pathlib.Path objects to str; return other objects as-is. """
    try:
        from pathlib import Path as _Path
    except ImportError:


        class _Path:
            pass
    if isinstance(path, _Path):
        return str(path)
    return path
