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

Mateusz Kwapich mitrandir at fb.com
Sun Oct 9 13:02:27 UTC 2016


# 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

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)]:


More information about the Mercurial-devel mailing list