fix: _bcrypt.__about__.__version__ log warning (#3136)
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from dataclasses import dataclass
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
|
||||||
|
import bcrypt
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
|
||||||
@@ -9,6 +11,15 @@ def _do_nothing(*_):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class SolveBugBcryptWarning:
|
||||||
|
__version__: str = getattr(bcrypt, "__version__") # noqa
|
||||||
|
|
||||||
|
|
||||||
|
# fix annoying warning in the logs
|
||||||
|
setattr(bcrypt, "__about__", SolveBugBcryptWarning()) # noqa
|
||||||
|
|
||||||
|
|
||||||
class CoreAppExtra:
|
class CoreAppExtra:
|
||||||
register_new_ext_routes: Callable = _do_nothing
|
register_new_ext_routes: Callable = _do_nothing
|
||||||
register_new_ratelimiter: Callable
|
register_new_ratelimiter: Callable
|
||||||
|
|||||||
Reference in New Issue
Block a user