Patchwork D10876: typing: suppress a false error in mercurial/revlogutils/docket.py on py2

login
register
mail settings
Submitter phabricator
Date June 12, 2021, 6:51 p.m.
Message ID <differential-rev-PHID-DREV-jl3cth34pvcyd6cfhjj4-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49197/
State Superseded
Headers show

Comments

phabricator - June 12, 2021, 6:51 p.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  `ord()` wants bytes or str on py3, so I'm guessing it got confused by passing a
  single byte instead of a one byte string.  But this seems to work on 2.7.18
  anyway.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/revlogutils/docket.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/revlogutils/docket.py b/mercurial/revlogutils/docket.py
--- a/mercurial/revlogutils/docket.py
+++ b/mercurial/revlogutils/docket.py
@@ -60,7 +60,9 @@ 
         if pycompat.ispy3:
             iter_seed = iter(seed)
         else:
+            # pytype: disable=wrong-arg-types
             iter_seed = (ord(c) for c in seed)
+            # pytype: enable=wrong-arg-types
         # some basic circular sum hashing on 64 bits
         int_seed = 0
         low_mask = int('1' * 35, 2)