Re: [PATCH 2/3] Remove support code for Python < 3.3

Ulrich Mueller <[email protected]>
Newsgroups gmane.linux.gentoo.portage.devel
Message-ID <[email protected]>
>>>>> On Fri, 17 Jul 2020, Michał Górny wrote:

> --- a/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py
> +++ b/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py
> @@ -34,12 +34,9 @@ class PreservedLibsRegistry(object):
>  
>  	_json_write_opts = {
>  		"ensure_ascii": False,
> -		"indent": "\t",
> -		"sort_keys": True
> +		"indent": 4,

This is assigning 4 now unconditionally, while it was "\t" before for
modern Python versions. Is this intentional?

> +		"sort_keys": True,

Why the added comma?

>  	}
> -	if sys.hexversion < 0x30200F0:
> -		# indent only supports int number of spaces
> -		_json_write_opts["indent"] = 4
>  
>  	def __init__(self, root, filename):
>  		"""


> --- a/lib/portage/util/mtimedb.py
> +++ b/lib/portage/util/mtimedb.py
> @@ -29,12 +29,9 @@ class MtimeDB(dict):
>  
>  	_json_write_opts = {
>  		"ensure_ascii": False,
> -		"indent": "\t",
> +		"indent": 4,

Same here.

>  		"sort_keys": True
>  	}
> -	if sys.hexversion < 0x30200F0:
> -		# indent only supports int number of spaces
> -		_json_write_opts["indent"] = 4
>  
>  	def __init__(self, filename):
>  		dict.__init__(self)

Ulrich
signature.asc (application/pgp-signature, 507 B)
-----BEGIN PGP SIGNATURE-----

iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAl8RXPEPHHVsbUBnZW50
b28ub3JnAAoJEFGIM1CIQV4ugJ4IAK31JV6yWohn9pXNmi5nQ7c7B/fVFXNeNzUX
MjdE9PWx3kSXHn8YJxuOfMz+Y5A7Q86mDmDYMHIemSJ3HfRCOYTD57oIiX+9DPti
4m5O+bBaC6qvl3PG3AaKevDtl19BTOAohoPn7007M3ud+tqCfxWlkreylIUBCDvk
KKOIab5F1nB3UPL89wLsK9lQv2aAqGYequW5IQGo7ifmtEsbevcHx9YJpc5/HbCe
Jx0EXepdq8FOmlhIrYx8iJgKtci2SjCatYtjcQ98LBntMLx8yw3obF71L8w/59rd
HvktHYUOsx/iVjUQYxl7tHePar5OtZzyZUvFAEUvHh2G8v+I21Q=
=6P5b
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.