@@ -3,7 +3,7 @@ use std::fmt::{Display, Write};
33use std:: str:: from_utf8;
44
55use pyo3:: exceptions:: { PyKeyError , PyTypeError , PyValueError } ;
6- use pyo3:: ffi;
6+ use pyo3:: ffi:: { self , c_str } ;
77use pyo3:: intern;
88use pyo3:: prelude:: * ;
99use pyo3:: sync:: GILOnceCell ;
@@ -73,7 +73,7 @@ impl ValidationError {
7373 return cause_problem;
7474 }
7575 }
76- PyErr :: from_value_bound ( err. into_bound ( py) . into_any ( ) )
76+ PyErr :: from_value ( err. into_bound ( py) . into_any ( ) )
7777 }
7878 Err ( err) => err,
7979 }
@@ -145,7 +145,7 @@ impl ValidationError {
145145 use pyo3:: exceptions:: PyUserWarning ;
146146
147147 let wrapped = PyUserWarning :: new_err ( ( note, ) ) ;
148- wrapped. set_cause ( py, Some ( PyErr :: from_value_bound ( err. clone_ref ( py) . into_bound ( py) ) ) ) ;
148+ wrapped. set_cause ( py, Some ( PyErr :: from_value ( err. clone_ref ( py) . into_bound ( py) ) ) ) ;
149149 user_py_errs. push ( wrapped) ;
150150 }
151151 }
@@ -202,10 +202,10 @@ fn include_url_env(py: Python) -> bool {
202202 match std:: env:: var_os ( "PYDANTIC_ERRORS_OMIT_URL" ) {
203203 Some ( val) => {
204204 // We don't care whether warning succeeded or not, hence the assignment
205- let _ = PyErr :: warn_bound (
205+ let _ = PyErr :: warn (
206206 py,
207- & py. get_type_bound :: < pyo3:: exceptions:: PyDeprecationWarning > ( ) ,
208- "PYDANTIC_ERRORS_OMIT_URL is deprecated, use PYDANTIC_ERRORS_INCLUDE_URL instead" ,
207+ & py. get_type :: < pyo3:: exceptions:: PyDeprecationWarning > ( ) ,
208+ c_str ! ( "PYDANTIC_ERRORS_OMIT_URL is deprecated, use PYDANTIC_ERRORS_INCLUDE_URL instead" ) ,
209209 1 ,
210210 ) ;
211211 // If OMIT_URL exists but is empty, we include the URL:
0 commit comments