1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00

fix: remove HTTPStatus constructs introduced in Python 3.11 (#11573)

* fix: remove HTTPStatus constructs introduced in Python 3.11

* add changelog frag
This commit is contained in:
Alexei Znamensky 2026-03-13 08:46:55 +13:00 committed by GitHub
parent 4cd91ba4d4
commit f9e583dae2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 21 additions and 24 deletions

View file

@ -71,7 +71,7 @@ def session_method_wrapper(f):
raise HwcClientException(0, f"Parsing response to json failed, error: {ex}") from ex
code = r.status_code
if not HTTPStatus(code).is_success:
if not (HTTPStatus.OK <= code < HTTPStatus.MULTIPLE_CHOICES): # not 2xx codes
msg = ""
for i in ["message", "error.message"]:
try: