From e6265295513b4a114ae7dc09db0e736d0e00d12b Mon Sep 17 00:00:00 2001 From: hirokuni-kitahara Date: Tue, 7 May 2024 14:30:59 +0900 Subject: [PATCH] update util function for parse-bool Signed-off-by: hirokuni-kitahara --- ansible_risk_insight/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible_risk_insight/utils.py b/ansible_risk_insight/utils.py index 60eb7032..561d3222 100644 --- a/ansible_risk_insight/utils.py +++ b/ansible_risk_insight/utils.py @@ -756,13 +756,13 @@ def parse_bool(value: any): value_str = value use_value_str = True elif isinstance(value, bytes): - _has_surrogateescape = False + surrogateescape_enabled = False try: codecs.lookup_error("surrogateescape") - _has_surrogateescape = True + surrogateescape_enabled = True except Exception: pass - errors = "surrogateescape" if _has_surrogateescape else "strict" + errors = "surrogateescape" if surrogateescape_enabled else "strict" value_str = value.decode("utf-8", errors) use_value_str = True