Patchwork D2528: error: fix isinstnace check to use bytes instead of str

login
register
mail settings
Submitter phabricator
Date March 1, 2018, 11:22 p.m.
Message ID <differential-rev-PHID-DREV-hk3lojtmixdcflqqlo4a-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28620/
State Superseded
Headers show

Comments

phabricator - March 1, 2018, 11:22 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/error.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/error.py b/mercurial/error.py
--- a/mercurial/error.py
+++ b/mercurial/error.py
@@ -47,7 +47,7 @@ 
         # this can't be called 'message' because at least some installs of
         # Python 2.6+ complain about the 'message' property being deprecated
         self.lookupmessage = message
-        if isinstance(name, str) and len(name) == 20:
+        if isinstance(name, bytes) and len(name) == 20:
             from .node import short
             name = short(name)
         RevlogError.__init__(self, '%s@%s: %s' % (index, name, message))