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

Michał Górny <[email protected]>
Newsgroups gmane.linux.gentoo.portage.devel
Message-ID <[email protected]>
Dnia July 17, 2020 8:10:25 AM UTC, Ulrich Mueller <[email protected]> napisał(a):
>>>>>> 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?

I'm sorry, this is my mistakd. I'll fix it when I get home.

>
>> +		"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


--
Best regards, 
Michał Górny
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.