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

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Fri Aug 5 12:18:05 EDT 2016


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. ?


> I suggested change the transformer in the previous py3 thread because I felt
> that was better than changing individual files manually.
> 
> Excerpts from Siddharth Agarwal's message of 2016-08-04 20:26:54 -0700:
> > I agree with Greg -- this makes things more complicated than necessary. 
> > We should just have a helper (e.g. util.environ) that gets assigned to 
> > os.environ on py2 and os.environb on py3. (And with possibly different 
> > behavior on Windows, similar to filenames.)
> > 
> > - Siddharth
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list