Skip to content

Commit 28c909c

Browse files
committed
Explicitly return None
1 parent 7380451 commit 28c909c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/targets/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,15 @@ def get_post_build_hook(self, toolchain_labels):
364364
Positional Arguments:
365365
hook - the hook object to add post-binary-hooks to
366366
toolchain - the toolchain object for inspection
367+
368+
Return Value:
369+
A callable if any post-build hook is applicable or None
367370
"""
368371

369-
# If there's no hook, simply return
370372
try:
371373
hook_data = self.post_binary_hook
372374
except AttributeError:
373-
return
375+
return None
374376
# A hook was found. The hook's name is in the format
375377
# "classname.functionname"
376378
temp = hook_data["function"].split(".")
@@ -403,7 +405,7 @@ def get_post_build_hook(self, toolchain_labels):
403405
toolchain_restrictions = set(hook_data.get("toolchains", []))
404406
if toolchain_restrictions and \
405407
not set(toolchain_labels).intersection(toolchain_restrictions):
406-
return
408+
return None
407409
return getattr(cls, function_name)
408410

409411
################################################################################

0 commit comments

Comments
 (0)