fix: _bcrypt.__about__.__version__ log warning (#3136)

This commit is contained in:
Vlad Stan 2025-04-30 20:44:55 +03:00 committed by GitHub
parent c4d0540e76
commit 32cbf16d91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,9 @@
from __future__ import annotations
from dataclasses import dataclass
from typing import Callable
import bcrypt
from pydantic import BaseModel
@ -9,6 +11,15 @@ def _do_nothing(*_):
pass
@dataclass
class SolveBugBcryptWarning:
__version__: str = getattr(bcrypt, "__version__") # noqa
# fix annoying warning in the logs
setattr(bcrypt, "__about__", SolveBugBcryptWarning()) # noqa
class CoreAppExtra:
register_new_ext_routes: Callable = _do_nothing
register_new_ratelimiter: Callable