Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 40689:475921a3028c
py3: cast attribute name to sysstr in clearcachedproperty()
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 22 Nov 2018 22:40:22 +0900 |
parents | 3c89227788a2 |
children | 0c638ff69f5c |
comparison
equal
deleted
inserted
replaced
40688:0d8425311f2f | 40689:475921a3028c |
---|---|
1533 # __dict__ assignment required to bypass __setattr__ (eg: repoview) | 1533 # __dict__ assignment required to bypass __setattr__ (eg: repoview) |
1534 obj.__dict__[self.name] = value | 1534 obj.__dict__[self.name] = value |
1535 | 1535 |
1536 def clearcachedproperty(obj, prop): | 1536 def clearcachedproperty(obj, prop): |
1537 '''clear a cached property value, if one has been set''' | 1537 '''clear a cached property value, if one has been set''' |
1538 prop = pycompat.sysstr(prop) | |
1538 if prop in obj.__dict__: | 1539 if prop in obj.__dict__: |
1539 del obj.__dict__[prop] | 1540 del obj.__dict__[prop] |
1540 | 1541 |
1541 def increasingchunks(source, min=1024, max=65536): | 1542 def increasingchunks(source, min=1024, max=65536): |
1542 '''return no less than min bytes per chunk while data remains, | 1543 '''return no less than min bytes per chunk while data remains, |