This repository was archived by the owner on Jan 11, 2021. It is now read-only.
File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -287,14 +287,14 @@ def __iter__(self):
287
287
yield ViewSetMethodIntrospector (self , methods [method ], method )
288
288
289
289
def _resolve_methods (self ):
290
- if not hasattr (self .pattern .callback , 'func_code ' ) or \
291
- not hasattr (self .pattern .callback , 'func_closure ' ) or \
292
- not hasattr (self .pattern .callback .func_code , 'co_freevars' ) or \
293
- 'actions' not in self .pattern .callback .func_code .co_freevars :
290
+ if not hasattr (self .pattern .callback , '__code__ ' ) or \
291
+ not hasattr (self .pattern .callback , '__closure__ ' ) or \
292
+ not hasattr (self .pattern .callback .__code__ , 'co_freevars' ) or \
293
+ 'actions' not in self .pattern .callback .__code__ .co_freevars :
294
294
raise RuntimeError ('Unable to use callback invalid closure/function specified.' )
295
295
296
- idx = self .pattern .callback .func_code .co_freevars .index ('actions' )
297
- return self .pattern .callback .func_closure [idx ].cell_contents
296
+ idx = self .pattern .callback .__code__ .co_freevars .index ('actions' )
297
+ return self .pattern .callback .__closure__ [idx ].cell_contents
298
298
299
299
300
300
class ViewSetMethodIntrospector (BaseMethodIntrospector ):
You can’t perform that action at this time.
0 commit comments