Skip to content

Commit

Permalink
Small fix to if-statement
Browse files Browse the repository at this point in the history
Ran across this while debugging something else. Fixing this en passant.

Signed-off-by: Carmen Bianca BAKKER <[email protected]>
  • Loading branch information
carmenbianca committed Oct 10, 2024
1 parent 52461b0 commit e1ae4b4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/reuse/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import shutil
import urllib.request
from pathlib import Path
from typing import Optional, cast
from typing import Optional
from urllib.error import URLError
from urllib.parse import urljoin

Expand Down Expand Up @@ -53,8 +53,10 @@ def download_license(spdx_identifier: str) -> str:
def _path_to_license_file(spdx_identifier: str, project: Project) -> Path:
root: Optional[Path] = project.root
# Hack
if cast(Path, root).name == "LICENSES" and isinstance(
project.vcs_strategy, VCSStrategyNone
if (
root
and root.name == "LICENSES"
and isinstance(project.vcs_strategy, VCSStrategyNone)
):
root = None

Expand Down

0 comments on commit e1ae4b4

Please sign in to comment.