Ensure HTTPError.response is not None
The implementation of `HTTPError` in `requests` does not guarantee that the `response` property will always be set. So we need to ensure it is not `None` before looking for the return code, for example. This also makes mypy checks pass again, as `types-request` was updated in 2.31.0.9 to better match this particular aspect. See: https://github.com/python/typeshed/pull/10875
This commit is contained in:
parent
968ddef295
commit
7344d264e7
7 changed files with 8 additions and 2 deletions
|
@ -160,6 +160,7 @@ class CGitLister(StatelessLister[Repositories]):
|
|||
try:
|
||||
bs = self._get_and_parse(repository_url)
|
||||
except HTTPError as e:
|
||||
assert e.response is not None
|
||||
logger.warning(
|
||||
"Unexpected HTTP status code %s on %s",
|
||||
e.response.status_code,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue