Mercurial > public > mercurial-scm > hg
diff mercurial/revlogutils/docket.py @ 48909:0aae0e2e90fc
revlogutils: unconditionally pass version to random seed
Differential Revision: https://phab.mercurial-scm.org/D12312
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 01 Mar 2022 20:37:09 -0800 |
parents | ed2af4560f6e |
children | 642e31cb55f0 |
line wrap: on
line diff
--- a/mercurial/revlogutils/docket.py Mon Feb 21 10:48:45 2022 -0700 +++ b/mercurial/revlogutils/docket.py Tue Mar 01 20:37:09 2022 -0800 @@ -25,7 +25,6 @@ encoding, error, node, - pycompat, util, ) @@ -65,10 +64,7 @@ low_part = (int_seed & low_mask) << 28 int_seed = high_part + low_part + i r = random.Random() - if pycompat.ispy3: - r.seed(int_seed, version=1) - else: - r.seed(int_seed) + r.seed(int_seed, version=1) # once we drop python 3.8 support we can simply use r.randbytes raw = r.getrandbits(id_size * 4) assert id_size == 8