homework_checker/core/tools.py
def expand_if_needed(input_path: Path) -> Path:
    """Expand the path if it is not absolute."""
    if input_path.is_absolute():
        return input_path
    new_path = input_path.expanduser()
    if new_path.is_absolute():
        # This path needed user expansion. Now that the user home directory is
        # expanded this is a full absolute path.
        return new_path
    # The user could not be expanded, so we assume it is just another relative
    # path to the current working directory.
    return Path.cwd() / new_path
Expand the path if it is not absolute.
Expand the path if it is not absolute.
Expand the path if it is not absolute .
def expand_if_needed(input_path: Path) -> Path:
    if input_path.is_absolute():
        return input_path
    new_path = input_path.expanduser()
    if new_path.is_absolute():
        return new_path
    return Path.cwd() / new_path
def expand_if_needed ( input_path : Path ) -> Path : if input_path . is_absolute ( ) : return input_path new_path = input_path . expanduser ( ) if new_path . is_absolute ( ) : return new_path return Path . cwd ( ) / new_path
Expand the path if it is not absolute.
Expand the path if it is not absolute .
"""Expand the path if it is not absolute.""" # This path needed user expansion. Now that the user home directory is # expanded this is a full absolute path. # The user could not be expanded, so we assume it is just another relative # path to the current working directory.
input_path
Path