awxkit: replace deprecated locale.format() with locale.format_string() 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.
This commit is contained in:
Beni ~HB9HNT 2024-05-22 21:27:31 +02:00 committed by GitHub
parent 892410477a
commit adf930ee42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)