Skip to content

Commit

Permalink
Repair a broken test
Browse files Browse the repository at this point in the history
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
  • Loading branch information
carmenbianca committed Jul 3, 2024
1 parent 0ac510a commit fcb257d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/reuse/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,15 @@ def _determine_license_suffix_path(path: StrPath) -> Path:
return Path(f"{path}.license")


def _parse_copyright_year(year: str) -> list:
def _parse_copyright_year(year: Optional[str]) -> List[str]:
"""Parse copyright years and return list."""
ret = []
ret: List[str] = []
if not year:
return ret
if re.match(r"\d{4}$", year):
ret = [int(year)]
ret = [year]
elif re.match(r"\d{4} ?- ?\d{4}$", year):
ret = [int(year[:4]), int(year[-4:])]
ret = [year[:4], year[-4:]]
return ret


Expand Down

0 comments on commit fcb257d

Please sign in to comment.