Patchwork D296: extensions: if on py3 and propname is a bytestr, convert to sysstr

login
register
mail settings
Submitter phabricator
Date Aug. 11, 2017, 7:52 p.m.
Message ID <4b340800f1fb421ccc5ba37847fe23b3@localhost.localdomain>
Download mbox | patch
Permalink /patch/22898/
State Not Applicable
Headers show

Comments

phabricator - Aug. 11, 2017, 7:52 p.m.
durin42 updated this revision to Diff 799.
durin42 marked 2 inline comments as done.
durin42 retitled this revision from "extensions: if on py3 and propname is a bytestr, decode as ascii" to "extensions: if on py3 and propname is a bytestr, convert to sysstr".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D296?vs=679&id=799

REVISION DETAIL
  https://phab.mercurial-scm.org/D296

AFFECTED FILES
  mercurial/extensions.py

CHANGE DETAILS




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 = pycompat.sysstr(propname)
     assert callable(wrapper)
     for currcls in cls.__mro__:
         if propname in currcls.__dict__: