Merge pull request #1641 from EDCD/fix/1061/python-deprecation-local.format

l10n: Use locale.format_string() instead of deprecated locale.format()
This commit is contained in:
Athanasius authored and GitHub committed 2022-08-15 12:00:21 +01:00
commit 2df1858fce
1 file changed
+2 -2
+2 -2
View File
@@ -284,10 +284,10 @@ class _Locale:
return self.float_formatter.stringFromNumber_(number)
if not decimals and isinstance(number, numbers.Integral):
return locale.format('%d', number, True)
return locale.format_string('%d', number, True)
else:
return locale.format('%.*f', (decimals, number), True) # type: ignore # It ends up working out
return locale.format_string('%.*f', (decimals, number), True)
def number_from_string(self, string: str) -> Union[int, float, None]:
"""