Mercurial > public > mercurial-scm > hg
comparison mercurial/extensions.py @ 33836:38a3767975a7
extensions: if on py3 and propname is a bytestr, convert to sysstr
Property names are unicodes on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D296
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 25 Jul 2017 22:49:43 -0400 |
parents | 62fbe95075d3 |
children | 0646608368a9 |
comparison
equal
deleted
inserted
replaced
33835:057d31ceace3 | 33836:38a3767975a7 |
---|---|
382 def wrapfilecache(cls, propname, wrapper): | 382 def wrapfilecache(cls, propname, wrapper): |
383 """Wraps a filecache property. | 383 """Wraps a filecache property. |
384 | 384 |
385 These can't be wrapped using the normal wrapfunction. | 385 These can't be wrapped using the normal wrapfunction. |
386 """ | 386 """ |
387 propname = pycompat.sysstr(propname) | |
387 assert callable(wrapper) | 388 assert callable(wrapper) |
388 for currcls in cls.__mro__: | 389 for currcls in cls.__mro__: |
389 if propname in currcls.__dict__: | 390 if propname in currcls.__dict__: |
390 origfn = currcls.__dict__[propname].func | 391 origfn = currcls.__dict__[propname].func |
391 assert callable(origfn) | 392 assert callable(origfn) |