File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -385,17 +385,15 @@ def get_post_build_hook(self, toolchain_labels):
385
385
# "class_name" must refer to a class in this file, so check if the
386
386
# class exists
387
387
mdata = self .get_module_data ()
388
- if class_name not in mdata or \
389
- not inspect .isclass (mdata [class_name ]):
388
+ if not inspect .isclass (mdata .get (class_name , None )):
390
389
raise HookError (
391
390
("Class '%s' required by '%s' in target '%s'"
392
391
% (class_name , hook_data ["function" ], self .name )) +
393
392
" not found in targets.py" )
394
393
# "function_name" must refer to a static function inside class
395
394
# "class_name"
396
395
cls = mdata [class_name ]
397
- if (not hasattr (cls , function_name )) or \
398
- (not inspect .isfunction (getattr (cls , function_name ))):
396
+ if not inspect .isfunction (getattr (cls , function_name , None )):
399
397
raise HookError (
400
398
("Static function '%s' " % function_name ) +
401
399
("required by '%s' " % hook_data ["function" ]) +
You can’t perform that action at this time.
0 commit comments