Skip to content

Commit 541b0f2

Browse files
committed
remove "assert response is not None"
1 parent f924b32 commit 541b0f2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

openml/_api/clients/http.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import xml
1010
from collections.abc import Callable, Mapping
1111
from pathlib import Path
12-
from typing import Any
12+
from typing import Any, cast
1313
from urllib.parse import urlencode, urljoin, urlparse
1414

1515
import requests
@@ -647,7 +647,9 @@ def request( # noqa: PLR0913, C901
647647
delay = self.retry_func(retry_counter)
648648
time.sleep(delay)
649649

650-
assert response is not None
650+
# response is guaranteed to be not `None`
651+
# otherwise an exception would have been raised before
652+
response = cast("Response", response)
651653

652654
if use_cache and self.cache is not None:
653655
cache_key = self.cache.get_key(url, params)

0 commit comments

Comments
 (0)