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 {
47
47
impl Debug for PyObjectSort {
48
48
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
49
49
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 ( ) ) ) ;
51
51
f. debug_struct ( "PyObjectSort" )
52
52
. field ( "objects" , & self . objects )
53
53
. field ( "id_to_index" , & self . id_to_index )
@@ -165,6 +165,7 @@ impl PyObjectSort {
165
165
fn __clear__ < ' py > ( & mut self , py : Python < ' py > ) {
166
166
self . hashable_to_index . bind ( py) . clear ( ) ;
167
167
self . objects . lock ( ) . unwrap ( ) . clear ( ) ;
168
+ self . id_to_index . lock ( ) . unwrap ( ) . clear ( ) ;
168
169
}
169
170
}
170
171
You can’t perform that action at this time.
0 commit comments