This commit is contained in:
Iliyan Angelov
2025-12-06 03:27:35 +02:00
parent 7667eb5eda
commit 5a8ca3c475
2211 changed files with 28086 additions and 37066 deletions

View File

@@ -22,7 +22,7 @@ class Protocol(str, Enum):
pickle = 'pickle'
@deprecated('`load_str_bytes` is deprecated.', category=None)
@deprecated('load_str_bytes is deprecated.', category=PydanticDeprecatedSince20)
def load_str_bytes(
b: str | bytes,
*,
@@ -32,7 +32,7 @@ def load_str_bytes(
allow_pickle: bool = False,
json_loads: Callable[[str], Any] = json.loads,
) -> Any:
warnings.warn('`load_str_bytes` is deprecated.', category=PydanticDeprecatedSince20, stacklevel=2)
warnings.warn('load_str_bytes is deprecated.', DeprecationWarning, stacklevel=2)
if proto is None and content_type:
if content_type.endswith(('json', 'javascript')):
pass
@@ -56,7 +56,7 @@ def load_str_bytes(
raise TypeError(f'Unknown protocol: {proto}')
@deprecated('`load_file` is deprecated.', category=None)
@deprecated('load_file is deprecated.', category=PydanticDeprecatedSince20)
def load_file(
path: str | Path,
*,
@@ -66,7 +66,7 @@ def load_file(
allow_pickle: bool = False,
json_loads: Callable[[str], Any] = json.loads,
) -> Any:
warnings.warn('`load_file` is deprecated.', category=PydanticDeprecatedSince20, stacklevel=2)
warnings.warn('load_file is deprecated.', DeprecationWarning, stacklevel=2)
path = Path(path)
b = path.read_bytes()
if content_type is None: