File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ Fix compilation failure with ` either ` feature enabled without ` experimental-inspect ` enabled.
Original file line number Diff line number Diff line change 94
94
} else if let Ok ( r) = obj. extract :: < R > ( ) {
95
95
Ok ( Either :: Right ( r) )
96
96
} else {
97
- let err_msg = format ! ( "failed to convert the value to '{}'" , Self :: type_input( ) ) ;
97
+ // TODO: it might be nice to use the `type_input()` name here once `type_input`
98
+ // is not experimental, rather than the Rust type names.
99
+ let err_msg = format ! (
100
+ "failed to convert the value to 'Union[{}, {}]'" ,
101
+ std:: any:: type_name:: <L >( ) ,
102
+ std:: any:: type_name:: <R >( )
103
+ ) ;
98
104
Err ( PyTypeError :: new_err ( err_msg) )
99
105
}
100
106
}
@@ -134,7 +140,7 @@ mod tests {
134
140
assert ! ( err. is_instance_of:: <PyTypeError >( py) ) ;
135
141
assert_eq ! (
136
142
err. to_string( ) ,
137
- "TypeError: failed to convert the value to 'Union[int, float ]'"
143
+ "TypeError: failed to convert the value to 'Union[i32, f32 ]'"
138
144
) ;
139
145
140
146
let obj_i = 42 . to_object ( py) ;
You can’t perform that action at this time.
0 commit comments