Submitter | phabricator |
---|---|
Date | Aug. 9, 2017, 2:24 p.m. |
Message ID | <differential-rev-PHID-DREV-hlbyj52bnk6q7cxerkvl-req@phab.mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/22794/ |
State | Superseded |
Headers | show |
Comments
yuja added inline comments. INLINE COMMENTS > extensions.py:388 > + if pycompat.ispy3 and isinstance(propname, bytes): > + propname = propname.decode('ascii') > assert callable(wrapper) `pycompat.sysstr()` ? > extensions.py:401 > raise AttributeError( > _("type '%s' has no property '%s'") % (cls, propname)) > Perhaps this shouldn't be bytes. Needs `r''` and drop `_()`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D296 To: durin42, #hg-reviewers Cc: yuja, mercurial-devel
durin42 added inline comments. INLINE COMMENTS > yuja wrote in extensions.py:401 > Perhaps this shouldn't be bytes. Needs `r''` and drop `_()`. Done in a followup change. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D296 To: durin42, #hg-reviewers Cc: yuja, mercurial-devel
yuja added inline comments. INLINE COMMENTS > yuja wrote in extensions.py:388 > `pycompat.sysstr()` ? The "if" shouldn't be necessary. That's what `sysstr()` is for. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D296 To: durin42, #hg-reviewers Cc: yuja, mercurial-devel
durin42 added a comment. Take another look? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D296 To: durin42, #hg-reviewers Cc: yuja, mercurial-devel
Patch
diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -384,6 +384,8 @@ These can't be wrapped using the normal wrapfunction. """ + if pycompat.ispy3 and isinstance(propname, bytes): + propname = propname.decode('ascii') assert callable(wrapper) for currcls in cls.__mro__: if propname in currcls.__dict__: