updates
This commit is contained in:
@@ -22,7 +22,7 @@ class Protocol(str, Enum):
|
||||
pickle = 'pickle'
|
||||
|
||||
|
||||
@deprecated('load_str_bytes is deprecated.', category=PydanticDeprecatedSince20)
|
||||
@deprecated('`load_str_bytes` is deprecated.', category=None)
|
||||
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.', DeprecationWarning, stacklevel=2)
|
||||
warnings.warn('`load_str_bytes` is deprecated.', category=PydanticDeprecatedSince20, 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=PydanticDeprecatedSince20)
|
||||
@deprecated('`load_file` is deprecated.', category=None)
|
||||
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.', DeprecationWarning, stacklevel=2)
|
||||
warnings.warn('`load_file` is deprecated.', category=PydanticDeprecatedSince20, stacklevel=2)
|
||||
path = Path(path)
|
||||
b = path.read_bytes()
|
||||
if content_type is None:
|
||||
|
||||
Reference in New Issue
Block a user