mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
[PR #11573/f9e583da backport][stable-12] fix: remove HTTPStatus constructs introduced in Python 3.11 (#11575)
fix: remove HTTPStatus constructs introduced in Python 3.11 (#11573)
* fix: remove HTTPStatus constructs introduced in Python 3.11
* add changelog frag
(cherry picked from commit f9e583dae2)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user