Skip to content

Commit

Permalink
Fix: Runtime context methods to fix return type
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 c2ac961 commit 5c3f018
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pontos/nvd/cve_change_history/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

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

from httpx import Timeout

Expand Down Expand Up @@ -150,3 +151,17 @@ async def cve_changes(

if results_per_page is not None:
start_index += results_per_page

async def __aenter__(self) -> "CVEChangeHistoryApi":
await super().__aenter__()
return self

async def __aexit__(
self,
exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException],
traceback: Optional[TracebackType],
) -> Optional[bool]:
return await super().__aexit__( # type: ignore
exc_type, exc_value, traceback
)

0 comments on commit 5c3f018

Please sign in to comment.