[PATCH 1 of 5] py3: make osenvironb a proxy for, instead of a copy of os.environ where needed

Yuya Nishihara yuya at tcha.org
Wed Sep 19 09:00:57 EDT 2018


On Wed, 19 Sep 2018 08:03:53 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1537323243 14400
> #      Tue Sep 18 22:14:03 2018 -0400
> # Node ID 6cf61fcd3fad06f14668a4cc56cc7c5351561219
> # Parent  fa681452b249f5d59dd77c925ce15b027758e8fe
> py3: make osenvironb a proxy for, instead of a copy of os.environ where needed

> +            @staticmethod
> +            def _strpathornone(b):
> +                if b is None:
> +                    return None
> +                return _strpath(b)
> +            @staticmethod
> +            def _bytespathornone(s):
> +                if s is None:
> +                    return None
> +                return _bytespath(s)

I think these functions can be removed since _bytespath/_strpath() handles None.

> +        osenvironb = envdict()

My two cents. envdict(os.environ) will look cleaner.


More information about the Mercurial-devel mailing list