Skip to content

Commit

Permalink
fixup: typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
16Martin committed Nov 20, 2024
1 parent 900029f commit 6485b3a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions capycli/bom/findsources.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import sys
import time
from collections.abc import Iterable
from typing import Any, Dict, List, Tuple
from typing import Any, Dict, List, Tuple, Set
from urllib.parse import urlparse, parse_qs

import requests
Expand Down Expand Up @@ -54,9 +54,9 @@ class TagCache:
existing tag many times.
"""
def __init__(self) -> None:
self.data: Dict[Tuple[str, str], set[str]] = {}
self.data: Dict[Tuple[str, str], Set[str]] = {}

def __getitem__(self, key: Any) -> set[str]:
def __getitem__(self, key: Any) -> Set[str]:
"""Get the set of all cached tags for a key."""
return self.data[self._validate_key(key)]

Expand Down Expand Up @@ -364,7 +364,8 @@ def get_matching_source_url(self, version: Any, github_ref: str,
# 'name' is a viable index, for instance an error message
tags = {}

source_url = self.get_matching_tag(tags.values(), version, url)
source_url = self.get_matching_tag(
list(tags.values()), version, url)
if len(source_url) > 0: # we found what we believe is
return source_url # the correct source_url
for name in tags:
Expand Down

0 comments on commit 6485b3a

Please sign in to comment.