Skip to content

Commit

Permalink
awxkit: replace deprecated locale.format() with locale.format_string(…
Browse files Browse the repository at this point in the history
…) to fix human output on Python 3.12 (#15170)

Replace deprecated locale.format with locale.format_string

This will be removed in Python 3.12 and will break human output unless fixed.
  • Loading branch information
hb9hnt committed May 22, 2024
1 parent 8924104 commit adf930e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion awxkit/awxkit/cli/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def format_human(output, fmt):

def format_num(v):
try:
return locale.format("%.*f", (0, int(v)), True)
return locale.format_string("%.*f", (0, int(v)), True)
except (ValueError, TypeError):
if isinstance(v, (list, dict)):
return json.dumps(v)
Expand Down

0 comments on commit adf930e

Please sign in to comment.