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

Yuya Nishihara yuya at tcha.org
Fri Aug 5 23:08:10 EDT 2016


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().


More information about the Mercurial-devel mailing list