[PATCH] py3: cast attribute name to sysstr in clearcachedproperty()

Yuya Nishihara yuya at tcha.org
Thu Nov 22 13:49:19 UTC 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1542894022 -32400
#      Thu Nov 22 22:40:22 2018 +0900
# Node ID 475921a3028c419ab50e17f2b8855e01cb1fa35e
# Parent  0d8425311f2f3f30491f4a4604498ea643d7c25a
py3: cast attribute name to sysstr in clearcachedproperty()

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1535,6 +1535,7 @@ class propertycache(object):
 
 def clearcachedproperty(obj, prop):
     '''clear a cached property value, if one has been set'''
+    prop = pycompat.sysstr(prop)
     if prop in obj.__dict__:
         del obj.__dict__[prop]
 


More information about the Mercurial-devel mailing list