Skip to content

Commit 94a03e1

Browse files
srcres258akpm00
authored andcommitted
scripts/show_delta: add __main__ judgement before main code
When doing Python programming it is a nice convention to insert the if statement `if __name__ == "__main__":` before any main code that does actual functionalities to ensure the code will be executed only as a script rather than as an imported module. Hence attach the missing judgement to show_delta. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Hu Haowen <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Reviewed-by: Miguel Ojeda <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Nicolas Schier <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 68279f9 commit 94a03e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/show_delta

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,5 @@ def main():
125125
for line in lines:
126126
print (convert_line(line, base_time),)
127127

128-
main()
128+
if __name__ == "__main__":
129+
main()

0 commit comments

Comments
 (0)