Gentoo Archives: gentoo-commits

From: "Manuel Rüger" <mrueg@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/
Date: Wed, 19 Jul 2017 20:54:33
Message-Id: 1500497553.becb67d7bf5e653d5646e974f2976b0ef5d63570.mrueg@gentoo
1 commit: becb67d7bf5e653d5646e974f2976b0ef5d63570
2 Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 4 22:56:59 2017 +0000
4 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 19 20:52:33 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=becb67d7
7
8 localization: Replace deprecated locale.format() with format_string()
9
10 pym/portage/localization.py | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13 diff --git a/pym/portage/localization.py b/pym/portage/localization.py
14 index 90202fb58..b215b9cba 100644
15 --- a/pym/portage/localization.py
16 +++ b/pym/portage/localization.py
17 @@ -39,7 +39,7 @@ def localized_size(num_bytes):
18 # always round up, so that small files don't end up as '0 KiB'
19 num_kib = math.ceil(num_bytes / 1024)
20 try:
21 - formatted_num = locale.format('%d', num_kib, grouping=True)
22 + formatted_num = locale.format_string('%d', num_kib, grouping=True)
23 except UnicodeDecodeError:
24 # failure to decode locale data
25 formatted_num = str(num_kib)