File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ impl ValidationError {
153153 {
154154 use pyo3:: exceptions:: PyUserWarning ;
155155
156- let wrapped = PyUserWarning :: new_err ( ( note, ) ) ;
156+ let wrapped = PyUserWarning :: new_err ( ( note. unbind ( ) , ) ) ;
157157 wrapped. set_cause ( py, Some ( PyErr :: from_value ( err. clone_ref ( py) . into_bound ( py) ) ) ) ;
158158 user_py_errs. push ( wrapped) ;
159159 }
@@ -168,7 +168,7 @@ impl ValidationError {
168168 #[ cfg( Py_3_11 ) ]
169169 let cause = {
170170 use pyo3:: exceptions:: PyBaseExceptionGroup ;
171- Some ( PyBaseExceptionGroup :: new_err ( ( title, user_py_errs) ) )
171+ Some ( PyBaseExceptionGroup :: new_err ( ( title, user_py_errs) ) . into_value ( py ) )
172172 } ;
173173
174174 // Pre 3.11 ExceptionGroup support, use the python backport instead:
@@ -192,7 +192,7 @@ impl ValidationError {
192192 if let Some ( cause) = cause {
193193 unsafe {
194194 // PyException_SetCause _steals_ a reference to cause, so must use .into_ptr()
195- ffi:: PyException_SetCause ( self_. as_ptr ( ) , cause. value ( py ) . clone ( ) . into_ptr ( ) ) ;
195+ ffi:: PyException_SetCause ( self_. as_ptr ( ) , cause. into_ptr ( ) ) ;
196196 }
197197 }
198198 }
You can’t perform that action at this time.
0 commit comments