1 |
>>>>> On Fri, 17 Jul 2020, Michał Górny wrote: |
2 |
|
3 |
> --- a/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py |
4 |
> +++ b/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py |
5 |
> @@ -34,12 +34,9 @@ class PreservedLibsRegistry(object): |
6 |
> |
7 |
> _json_write_opts = { |
8 |
> "ensure_ascii": False, |
9 |
> - "indent": "\t", |
10 |
> - "sort_keys": True |
11 |
> + "indent": 4, |
12 |
|
13 |
This is assigning 4 now unconditionally, while it was "\t" before for |
14 |
modern Python versions. Is this intentional? |
15 |
|
16 |
> + "sort_keys": True, |
17 |
|
18 |
Why the added comma? |
19 |
|
20 |
> } |
21 |
> - if sys.hexversion < 0x30200F0: |
22 |
> - # indent only supports int number of spaces |
23 |
> - _json_write_opts["indent"] = 4 |
24 |
> |
25 |
> def __init__(self, root, filename): |
26 |
> """ |
27 |
|
28 |
|
29 |
> --- a/lib/portage/util/mtimedb.py |
30 |
> +++ b/lib/portage/util/mtimedb.py |
31 |
> @@ -29,12 +29,9 @@ class MtimeDB(dict): |
32 |
> |
33 |
> _json_write_opts = { |
34 |
> "ensure_ascii": False, |
35 |
> - "indent": "\t", |
36 |
> + "indent": 4, |
37 |
|
38 |
Same here. |
39 |
|
40 |
> "sort_keys": True |
41 |
> } |
42 |
> - if sys.hexversion < 0x30200F0: |
43 |
> - # indent only supports int number of spaces |
44 |
> - _json_write_opts["indent"] = 4 |
45 |
> |
46 |
> def __init__(self, filename): |
47 |
> dict.__init__(self) |
48 |
|
49 |
Ulrich |