File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 6
6
- _ cattrs_ is now linted with [ Ruff] ( https://beta.ruff.rs/docs/ ) .
7
7
- Fix TypedDicts with periods in their field names.
8
8
([ #376 ] ( https://github.com/python-attrs/cattrs/issues/376 ) [ #377 ] ( https://github.com/python-attrs/cattrs/pull/377 ) )
9
+ - Fix ` format_exception ` and ` transform_error ` type annotations.
9
10
10
11
## 23.1.2 (2023-06-02)
11
12
Original file line number Diff line number Diff line change 1
1
"""Cattrs validation."""
2
- from typing import Callable , List , Type , Union
2
+ from typing import Callable , List , Union
3
3
4
4
from .errors import (
5
5
ClassValidationError ,
10
10
__all__ = ["format_exception" , "transform_error" ]
11
11
12
12
13
- def format_exception (exc : BaseException , type : Union [Type , None ]) -> str :
13
+ def format_exception (exc : BaseException , type : Union [type , None ]) -> str :
14
14
"""The default exception formatter, handling the most common exceptions.
15
15
16
16
The following exceptions are handled specially:
@@ -61,7 +61,7 @@ def transform_error(
61
61
exc : Union [ClassValidationError , IterableValidationError , BaseException ],
62
62
path : str = "$" ,
63
63
format_exception : Callable [
64
- [BaseException , Union [Type , None ]], str
64
+ [BaseException , Union [type , None ]], str
65
65
] = format_exception ,
66
66
) -> List [str ]:
67
67
"""Transform an exception into a list of error messages.
You can’t perform that action at this time.
0 commit comments