File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1- use pyo3:: exceptions:: PyKeyError ;
1+ use pyo3:: exceptions:: { PyDeprecationWarning , PyKeyError } ;
22use pyo3:: intern;
33use pyo3:: prelude:: * ;
44use pyo3:: types:: { PyDict , PySet , PyString , PyType } ;
5+ use pyo3:: PyTypeInfo ;
56
67use ahash:: AHashSet ;
78
@@ -187,7 +188,7 @@ impl Validator for ModelFieldsValidator {
187188 used_keys. insert ( lookup_path. first_key ( ) ) ;
188189 }
189190 if let Some ( msg) = & field. deprecation_msg {
190- let deprecation_warning_type = py . import_bound ( "builtins" ) ? . getattr ( "DeprecationWarning" ) ? ;
191+ let deprecation_warning_type = PyDeprecationWarning :: type_object_bound ( py ) ;
191192 PyErr :: warn_bound ( py, & deprecation_warning_type, msg, 2 ) ?;
192193 }
193194 match field. validator . validate ( py, value. borrow_input ( ) , state) {
You can’t perform that action at this time.
0 commit comments