File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -204,24 +204,24 @@ fn subs_tvars(
204
204
argitems : & [ PyObjectRef ] ,
205
205
vm : & VirtualMachine ,
206
206
) -> PyResult {
207
- let sub_params = obj. clone ( ) . get_attr ( "__parameters__" , vm) ?;
208
- if let Ok ( sub_params) = PyTupleRef :: try_from_object ( vm, sub_params) {
209
- let sub_args = sub_params
210
- . as_slice ( )
211
- . iter ( )
212
- . map ( |arg| {
213
- if let Some ( idx) = tuple_index ( params, arg) {
214
- argitems[ idx] . clone ( )
215
- } else {
216
- arg. clone ( )
217
- }
218
- } )
219
- . collect :: < Vec < _ > > ( ) ;
220
- let sub_args: PyObjectRef = PyTuple :: new_ref ( sub_args, & vm. ctx ) . into ( ) ;
221
- obj. get_item ( sub_args, vm)
222
- } else {
223
- Ok ( obj)
207
+ if let Some ( sub_params) = obj. class ( ) . get_attr ( "__parameters__" ) {
208
+ if let Ok ( sub_params) = PyTupleRef :: try_from_object ( vm, sub_params) {
209
+ let sub_args = sub_params
210
+ . as_slice ( )
211
+ . iter ( )
212
+ . map ( |arg| {
213
+ if let Some ( idx) = tuple_index ( params, arg) {
214
+ argitems[ idx] . clone ( )
215
+ } else {
216
+ arg. clone ( )
217
+ }
218
+ } )
219
+ . collect :: < Vec < _ > > ( ) ;
220
+ let sub_args: PyObjectRef = PyTuple :: new_ref ( sub_args, & vm. ctx ) . into ( ) ;
221
+ return obj. get_item ( sub_args, vm) ;
222
+ }
224
223
}
224
+ Ok ( obj)
225
225
}
226
226
227
227
impl AsMapping for PyGenericAlias {
You can’t perform that action at this time.
0 commit comments