changeset 30086:f3a1089654e3

pycompat: when setting attrs, ensure we use sysstr The custom module importer was making these bytes, so when we poked values into self.__dict__ we had bytes instead of unicode on py3 and it didn't work.
author Augie Fackler <augie@google.com>
date Sat, 08 Oct 2016 08:35:43 -0400
parents 2bde971474d2
children 9b230a8e6008
files mercurial/pycompat.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/pycompat.py	Sat Oct 08 05:26:18 2016 -0400
+++ b/mercurial/pycompat.py	Sat Oct 08 08:35:43 2016 -0400
@@ -74,8 +74,10 @@
 
     def _registeraliases(self, origin, items):
         """Add items that will be populated at the first access"""
-        self._aliases.update((item.replace('_', '').lower(), (origin, item))
-                             for item in items)
+        items = map(sysstr, items)
+        self._aliases.update(
+            (item.replace(sysstr('_'), sysstr('')).lower(), (origin, item))
+            for item in items)
 
     def __getattr__(self, name):
         try: