changeset 32207:89153b0d4881

py3: make adefaults keys str to be compatible with getattr getattr passes a str value of the attribute to be looked and keys in adefaults dict are bytes which resulted in AttributeError. This patch abuses r'' to make the keys str.
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 04 May 2017 00:44:53 +0530
parents 09fb3d3b1b3a
children 0fd15522a848
files mercurial/dispatch.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Wed May 03 15:41:28 2017 +0530
+++ b/mercurial/dispatch.py	Thu May 04 00:44:53 2017 +0530
@@ -479,7 +479,8 @@
         return aliasargs(self.fn, args)
 
     def __getattr__(self, name):
-        adefaults = {'norepo': True, 'optionalrepo': False, 'inferrepo': False}
+        adefaults = {r'norepo': True,
+                     r'optionalrepo': False, r'inferrepo': False}
         if name not in adefaults:
             raise AttributeError(name)
         if self.badalias or util.safehasattr(self, 'shell'):