comparison mercurial/revlogutils/docket.py @ 47423:be903d043099

typing: suppress a false error in mercurial/revlogutils/docket.py on py2 `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. Differential Revision: https://phab.mercurial-scm.org/D10876
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 12 Jun 2021 14:50:33 -0400
parents e6292eb33384
children c252631500e4
comparison
equal deleted inserted replaced
47422:88439c6fbafc 47423:be903d043099
58 raise 58 raise
59 seed = b'04' # chosen by a fair dice roll. garanteed to be random 59 seed = b'04' # chosen by a fair dice roll. garanteed to be random
60 if pycompat.ispy3: 60 if pycompat.ispy3:
61 iter_seed = iter(seed) 61 iter_seed = iter(seed)
62 else: 62 else:
63 # pytype: disable=wrong-arg-types
63 iter_seed = (ord(c) for c in seed) 64 iter_seed = (ord(c) for c in seed)
65 # pytype: enable=wrong-arg-types
64 # some basic circular sum hashing on 64 bits 66 # some basic circular sum hashing on 64 bits
65 int_seed = 0 67 int_seed = 0
66 low_mask = int('1' * 35, 2) 68 low_mask = int('1' * 35, 2)
67 for i in iter_seed: 69 for i in iter_seed:
68 high_part = int_seed >> 35 70 high_part = int_seed >> 35