def _safe_sub(a_re, a_sub, a_line):
    """Perform substitution on line and return it unchanged if line gets empty

    Args:
    -----
      a_re - regular expression to substitue
      a_sub - substitution
      a_line - line where the substitution should be done

    Returns:
    --------
      (str): line with substitutions or unchanged line if it got empty

    """
    return a_re.sub(a_sub, a_line).strip() or a_line