Skip to content

Commit

Permalink
Add comment for ValueError raise.
Browse files Browse the repository at this point in the history
  • Loading branch information
another-rex committed Sep 3, 2024
1 parent 04424e4 commit d89d06a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions gcp/api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,8 @@ def to_response(b: osv.Bug):
else:
context.service_context.abort(grpc.StatusCode.INVALID_ARGUMENT,
'Invalid query.')
# This will never be reached, and is just here for the type checker,
# to know that control flow breaks here.
raise ValueError

# Asynchronously retrieve computed aliases and related ids here
Expand Down
6 changes: 3 additions & 3 deletions osv/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import os

from urllib.parse import urlparse
from typing import List, Self
from typing import Self

from google.cloud import ndb
from google.protobuf import json_format
Expand Down Expand Up @@ -89,8 +89,8 @@ def _repo_name(repo_url: str) -> str:
return name


def _maybe_strip_repo_prefixes(versions: List[str],
repo_urls: List[str]) -> str:
def _maybe_strip_repo_prefixes(versions: list[str],
repo_urls: list[str]) -> str:
"""Try to strip the repo name from tags prior to normalizing.
There are some particularly regex-unfriendly tag names that prefix the
Expand Down

0 comments on commit d89d06a

Please sign in to comment.