File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ pub struct PyObjectSort {
4747impl Debug for PyObjectSort {
4848 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
4949 let hashable_to_index =
50- Python :: with_gil ( |py| self . hashable_to_index . bind ( py) . str ( ) . unwrap ( ) . to_string ( ) ) ;
50+ Python :: with_gil ( |py| self . hashable_to_index . bind ( py) . str ( ) . map_or_else ( |_| "<error>" . to_string ( ) , |s| s . to_string ( ) ) ) ;
5151 f. debug_struct ( "PyObjectSort" )
5252 . field ( "objects" , & self . objects )
5353 . field ( "id_to_index" , & self . id_to_index )
@@ -165,6 +165,7 @@ impl PyObjectSort {
165165 fn __clear__ < ' py > ( & mut self , py : Python < ' py > ) {
166166 self . hashable_to_index . bind ( py) . clear ( ) ;
167167 self . objects . lock ( ) . unwrap ( ) . clear ( ) ;
168+ self . id_to_index . lock ( ) . unwrap ( ) . clear ( ) ;
168169 }
169170}
170171
You can’t perform that action at this time.
0 commit comments