1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

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 2022-08-15 12:00:21 +01:00 committed by GitHub
commit 2df1858fce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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]:
"""