@@ -12,8 +12,8 @@ use pyo3::{
1212 ffi:: { self , PyTuple_Size } ,
1313 pyobject_native_type_extract, pyobject_native_type_named,
1414 types:: { PyDict , PyTuple , PyType } ,
15- AsPyPointer , FromPyObject , FromPyPointer , IntoPyPointer , PyAny , PyNativeType , PyObject ,
16- PyResult , PyTypeInfo , Python , ToPyObject ,
15+ AsPyPointer , FromPyObject , FromPyPointer , PyAny , PyNativeType , PyObject , PyResult , PyTypeInfo ,
16+ Python , ToPyObject ,
1717} ;
1818#[ cfg( feature = "half" ) ]
1919use pyo3:: { sync:: GILOnceCell , IntoPy , Py } ;
@@ -352,7 +352,7 @@ impl PyArrayDescr {
352352 let dict = unsafe { PyDict :: from_borrowed_ptr ( self . py ( ) , ( * self . as_dtype_ptr ( ) ) . fields ) } ;
353353 // NumPy guarantees that fields are tuples of proper size and type, so this should never panic.
354354 let tuple = dict
355- . get_item ( name)
355+ . get_item ( name) ?
356356 . ok_or_else ( || PyIndexError :: new_err ( name. to_owned ( ) ) ) ?
357357 . downcast :: < PyTuple > ( )
358358 . unwrap ( ) ;
@@ -609,6 +609,7 @@ mod tests {
609609 let dt = locals
610610 . get_item ( "dtype" )
611611 . unwrap ( )
612+ . unwrap ( )
612613 . downcast :: < PyArrayDescr > ( )
613614 . unwrap ( ) ;
614615
@@ -644,6 +645,7 @@ mod tests {
644645 let dt = locals
645646 . get_item ( "dtype" )
646647 . unwrap ( )
648+ . unwrap ( )
647649 . downcast :: < PyArrayDescr > ( )
648650 . unwrap ( ) ;
649651
0 commit comments