[PATCH] py3: handle os.environ.get() case in module loader

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Aug 5 23:14:06 EDT 2016



On 08/06/2016 05:08 AM, Yuya Nishihara wrote:
> On Sat, 06 Aug 2016 01:18:05 +0900, FUJIWARA Katsunori wrote:
>> At Fri, 5 Aug 2016 12:12:36 +0100,
>> Jun Wu wrote:
>>>
>>> util.environ looks better. ui.environ has issues for places without the ui
>>> object.
>>
>> IMHO, for availability (and less code duplication), we should define
>> such helpers in other than util.py, because using helpers in util.py
>> causes cyclic importing in i18n, encoding and so on.
>>
>> Of course, making util.py provide imported helpers as own functions
>> can avoid adding new import statement for such helper.
>>
>> The role of pycompat.py itself seems good for this purpose, but is it
>> a little large to be imported in i18n, encoding and so on. ?
>
> pycompat seems fine. It should be loaded anyway on Python 3 to reintroduce
> xrange().

+1 for pycompat

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list