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

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Fri Aug 11 15:52:17 EDT 2017


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

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__:



To: durin42, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list