Skip to content

Commit

Permalink
Change: Use JSON type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
n-thumann authored and greenbonebot committed Nov 10, 2023
1 parent 9c406a9 commit b6f2e5c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pontos/nvd/cve_change_history/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# SPDX-License-Identifier: GPL-3.0-or-later

from datetime import datetime, timedelta
from types import TracebackType
from typing import Any, AsyncIterator, Dict, Iterable, Optional, Type, Union
from typing import AsyncIterator, Iterable, Optional

from httpx import Timeout

from pontos.errors import PontosError
from pontos.nvd.api import (
DEFAULT_TIMEOUT_CONFIG,
JSON,
NVDApi,
Params,
convert_camel_case,
Expand Down Expand Up @@ -139,9 +139,7 @@ async def cve_changes(
response = await self._get(params=params)
response.raise_for_status()

data: Dict[str, Union[int, str, Dict[str, Any]]] = response.json(
object_hook=convert_camel_case
)
data: JSON = response.json(object_hook=convert_camel_case)

total_results = data["total_results"] # type: ignore
results_per_page: int = data["results_per_page"] # type: ignore
Expand All @@ -155,4 +153,3 @@ async def cve_changes(
async def __aenter__(self) -> "CVEChangeHistoryApi":
await super().__aenter__()
return self

0 comments on commit b6f2e5c

Please sign in to comment.