Patchwork [3,of,3,py3] repoview: convert attribute names to unicodes on Python 3

login
register
mail settings
Submitter Pulkit Goyal
Date March 7, 2017, 7:21 p.m.
Message ID <3f1b6aded120622ec019.1488914485@pulkit-goyal>
Download mbox | patch
Permalink /patch/18970/
State Accepted
Headers show

Comments

Pulkit Goyal - March 7, 2017, 7:21 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1488914355 -19800
#      Wed Mar 08 00:49:15 2017 +0530
# Node ID 3f1b6aded120622ec0195ab180cddd8cf09dc59e
# Parent  6ff8f348d278599b1dd79aa6b4d7c7c231ca7b58
repoview: convert attribute names to unicodes on Python 3

In Python 3, the attribute names must be strings i.e. unicodes.

Patch

diff -r 6ff8f348d278 -r 3f1b6aded120 mercurial/repoview.py
--- a/mercurial/repoview.py	Wed Mar 08 00:45:19 2017 +0530
+++ b/mercurial/repoview.py	Wed Mar 08 00:49:15 2017 +0530
@@ -300,10 +300,10 @@ 
     """
 
     def __init__(self, repo, filtername):
-        object.__setattr__(self, '_unfilteredrepo', repo)
-        object.__setattr__(self, 'filtername', filtername)
-        object.__setattr__(self, '_clcachekey', None)
-        object.__setattr__(self, '_clcache', None)
+        object.__setattr__(self, r'_unfilteredrepo', repo)
+        object.__setattr__(self, r'filtername', filtername)
+        object.__setattr__(self, r'_clcachekey', None)
+        object.__setattr__(self, r'_clcache', None)
 
     # not a propertycache on purpose we shall implement a proper cache later
     @property