mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 03:17:39 -02:30
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:
@@ -185,7 +185,7 @@ def format_human(output, fmt):
|
|||||||
|
|
||||||
def format_num(v):
|
def format_num(v):
|
||||||
try:
|
try:
|
||||||
return locale.format("%.*f", (0, int(v)), True)
|
return locale.format_string("%.*f", (0, int(v)), True)
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
if isinstance(v, (list, dict)):
|
if isinstance(v, (list, dict)):
|
||||||
return json.dumps(v)
|
return json.dumps(v)
|
||||||
|
|||||||
Reference in New Issue
Block a user