Skip to content

Commit

Permalink
update util function for parse-bool
Browse files Browse the repository at this point in the history
Signed-off-by: hirokuni-kitahara <[email protected]>
  • Loading branch information
hirokuni-kitahara committed May 7, 2024
1 parent 32a00e4 commit e626529
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ansible_risk_insight/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e626529

Please sign in to comment.