fix: _bcrypt.__about__.__version__ log warning (#3136)
This commit is contained in:
parent
c4d0540e76
commit
32cbf16d91
1 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue