Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o, Ulrich Mueller <ulm@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH 2/3] Remove support code for Python < 3.3
Date: Fri, 17 Jul 2020 10:58:39
Message-Id: 4C4BFFBC-B93B-4F9D-B381-941B16F09EDD@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH 2/3] Remove support code for Python < 3.3 by Ulrich Mueller
1 Dnia July 17, 2020 8:10:25 AM UTC, Ulrich Mueller <ulm@g.o> napisał(a):
2 >>>>>> On Fri, 17 Jul 2020, Michał Górny wrote:
3 >
4 >> --- a/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py
5 >> +++ b/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py
6 >> @@ -34,12 +34,9 @@ class PreservedLibsRegistry(object):
7 >>
8 >> _json_write_opts = {
9 >> "ensure_ascii": False,
10 >> - "indent": "\t",
11 >> - "sort_keys": True
12 >> + "indent": 4,
13 >
14 >This is assigning 4 now unconditionally, while it was "\t" before for
15 >modern Python versions. Is this intentional?
16
17 I'm sorry, this is my mistakd. I'll fix it when I get home.
18
19 >
20 >> + "sort_keys": True,
21 >
22 >Why the added comma?
23 >
24 >> }
25 >> - if sys.hexversion < 0x30200F0:
26 >> - # indent only supports int number of spaces
27 >> - _json_write_opts["indent"] = 4
28 >>
29 >> def __init__(self, root, filename):
30 >> """
31 >
32 >
33 >> --- a/lib/portage/util/mtimedb.py
34 >> +++ b/lib/portage/util/mtimedb.py
35 >> @@ -29,12 +29,9 @@ class MtimeDB(dict):
36 >>
37 >> _json_write_opts = {
38 >> "ensure_ascii": False,
39 >> - "indent": "\t",
40 >> + "indent": 4,
41 >
42 >Same here.
43 >
44 >> "sort_keys": True
45 >> }
46 >> - if sys.hexversion < 0x30200F0:
47 >> - # indent only supports int number of spaces
48 >> - _json_write_opts["indent"] = 4
49 >>
50 >> def __init__(self, filename):
51 >> dict.__init__(self)
52 >
53 >Ulrich
54
55
56 --
57 Best regards,
58 Michał Górny