vendor cmp()

This commit is contained in:
Alexandre Detiste 2024-12-21 14:57:09 +01:00
parent 5105112475
commit 4ac60c5c86
2 changed files with 6 additions and 5 deletions

View File

@ -51,13 +51,14 @@ system where Tahoe is installed, or in a source tree with setup.py like this:
setup.py run_with_pythonpath -p -c 'misc/make-canary-files.py ARGS..'
"""
from past.builtins import cmp
import os, hashlib
from twisted.python import usage
from allmydata.immutable import upload
from allmydata.util import base32
def cmp(a, b):
return (a > b) - (a < b)
class Options(usage.Options):
optParameters = [
("convergence", "c", None, "path to NODEDIR/private/convergence"),

View File

@ -2,13 +2,13 @@
# WARNING. There is a bug in this script so that it does not simulate the actual Tahoe Two server selection algorithm that it was intended to simulate. See http://allmydata.org/trac/tahoe-lafs/ticket/302 (stop permuting peerlist, use SI as offset into ring instead?)
from past.builtins import cmp
import random
SERVER_CAPACITY = 10**12
def cmp(a, b):
return (a > b) - (a < b)
class Server(object):
def __init__(self):
self.si = random.randrange(0, 2**31)