[PATCH] store: get rid of dict comprehension for py2.6 compat

Pulkit Goyal 7895pulkit at gmail.com
Sun Oct 9 09:05:46 EDT 2016


On Sun, Oct 9, 2016 at 3:02 PM, Mateusz Kwapich <mitrandir at fb.com> wrote:
> # HG changeset patch
> # User Mateusz Kwapich <mitrandir at fb.com>
> # Date 1476018084 25200
> #      Sun Oct 09 06:01:24 2016 -0700
> # Node ID 801817b85eb04a7d6c9d211b2a34d7e140ce8ecb
> # Parent  da08f4707282747cef3619341e07bd492470f41e
> store: get rid of dict comprehension for py2.6 compat

Martijn already fixed this one and that is pushed.
> That's my bad. Let's change it to dict(generator).
>
> diff --git a/mercurial/store.py b/mercurial/store.py
> --- a/mercurial/store.py
> +++ b/mercurial/store.py
> @@ -107,7 +107,7 @@ def _buildencodefun():
>          asciistr = map(chr, xrange(127))
>      capitals = list(range(ord("A"), ord("Z") + 1))
>
> -    cmap = {x:x for x in asciistr}
> +    cmap = dict(((x,x) for x in asciistr))
>      for x in _reserved():
>          cmap[xchr(x)] = "~%02x" % x
>      for x in capitals + [ord(e)]:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list