fix: Python 3.12 compatibility — randint() no longer accepts floats (#2531)

Co-authored-by: Ayoub Zaki <ayoub.zaki@embetrix.com>
Co-authored-by: k9ert <117085+k9ert@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
al-munazzim 2026-03-19 10:13:00 -03:00 committed by GitHub
parent a60e98ea8e
commit 304649a8b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 9 additions and 10 deletions

View file

@ -11,7 +11,7 @@ logger = logging.getLogger(__name__)
hwi_server = Blueprint("hwi_server", __name__)
CORS(hwi_server)
rand = random.randint(0, 1e32) # to force style refresh
rand = random.randint(0, int(1e32)) # to force style refresh
@hwi_server.route("/", methods=["GET"])

View file

@ -16,7 +16,7 @@ from ..services import ExtensionException
from ..user import User, hash_password, verify_password
from ..rpc import BitcoinRPC, _detect_rpc_confs_via_datadir
rand = random.randint(0, 1e32) # to force style refresh
rand = random.randint(0, int(1e32)) # to force style refresh
last_sensitive_request = 0 # to rate limit sensitive requests
# Setup endpoint blueprint

View file

@ -58,7 +58,7 @@ app.register_blueprint(setup_endpoint, url_prefix=f"{spc_prefix}/setup")
app.register_blueprint(wallets_endpoint, url_prefix=f"{spc_prefix}/wallets")
app.register_blueprint(wallets_endpoint_api, url_prefix=f"{spc_prefix}/wallets")
rand = random.randint(0, 1e32) # to force style refresh
rand = random.randint(0, int(1e32)) # to force style refresh
logger = logging.getLogger(__name__)
########## exception handlers ##############

View file

@ -26,8 +26,7 @@ from ..wallet import purposes
logger = logging.getLogger(__name__)
rand = random.randint(0, 1e32) # to force style refresh
logger = logging.getLogger(__name__)
rand = random.randint(0, int(1e32)) # to force style refresh
# Setup endpoint blueprint
devices_endpoint = Blueprint("devices_endpoint", __name__)

View file

@ -24,7 +24,7 @@ from ..server_endpoints import flash
logger = logging.getLogger(__name__)
rand = random.randint(0, 1e32) # to force style refresh
rand = random.randint(0, int(1e32)) # to force style refresh
# Setup endpoint blueprint
nodes_endpoint = Blueprint("nodes_endpoint", __name__)

View file

@ -38,7 +38,7 @@ from ..util.tor import start_hidden_service, stop_hidden_services
logger = logging.getLogger(__name__)
rand = random.randint(0, 1e32) # to force style refresh
rand = random.randint(0, int(1e32)) # to force style refresh
# Setup endpoint blueprint
settings_endpoint = Blueprint("settings_endpoint", __name__)

View file

@ -23,7 +23,7 @@ from ..util.tor_setup_tasks import setup_tor_thread
logger = logging.getLogger(__name__)
rand = random.randint(0, 1e32) # to force style refresh
rand = random.randint(0, int(1e32)) # to force style refresh
# Setup endpoint blueprint
setup_endpoint = Blueprint("setup_endpoint", __name__)

View file

@ -31,7 +31,7 @@ from .wallets_vm import WalletsOverviewVm
logger = logging.getLogger(__name__)
rand = random.randint(0, 1e32) # to force style refresh
rand = random.randint(0, int(1e32)) # to force style refresh
# Setup endpoint blueprint
wallets_endpoint = Blueprint("wallets_endpoint", __name__)

View file

@ -17,7 +17,7 @@ from .welcome_vm import WelcomeVm
logger = logging.getLogger(__name__)
rand = random.randint(0, 1e32) # to force style refresh
rand = random.randint(0, int(1e32)) # to force style refresh
# Setup endpoint blueprint
welcome_endpoint = Blueprint("welcome_endpoint", __name__)