codekingpro/portable-devtools
114k
1from __future__ import annotations2 3import typing as t4 5from .encoding import base64_decode as base64_decode6from .encoding import base64_encode as base64_encode7from .encoding import want_bytes as want_bytes8from .exc import BadData as BadData9from .exc import BadHeader as BadHeader10from .exc import BadPayload as BadPayload11from .exc import BadSignature as BadSignature12from .exc import BadTimeSignature as BadTimeSignature13from .exc import SignatureExpired as SignatureExpired14from .serializer import Serializer as Serializer15from .signer import HMACAlgorithm as HMACAlgorithm16from .signer import NoneAlgorithm as NoneAlgorithm17from .signer import Signer as Signer18from .timed import TimedSerializer as TimedSerializer19from .timed import TimestampSigner as TimestampSigner20from .url_safe import URLSafeSerializer as URLSafeSerializer21from .url_safe import URLSafeTimedSerializer as URLSafeTimedSerializer22 23 24def __getattr__(name: str) -> t.Any:25 if name == "__version__":26 import importlib.metadata27 import warnings28 29 warnings.warn(30 "The '__version__' attribute is deprecated and will be removed in"31 " ItsDangerous 2.3. Use feature detection or"32 " 'importlib.metadata.version(\"itsdangerous\")' instead.",33 DeprecationWarning,34 stacklevel=2,35 )36 return importlib.metadata.version("itsdangerous")37 38 raise AttributeError(name)39 