path: root/tools
diff options
authorSimon Glass <>2015-07-30 13:47:41 -0600
committerSimon Glass <>2015-07-31 07:31:12 -0600
commit9649e152cbdd98d836912c45acd1f03fc70a21a5 (patch)
treee82a82d7f4ba70e70c7456cc1d8ce4e7e31d4189 /tools
parentcc35734358540a1bbaf042fdf9f4cb2de17389ed (diff)
patman: Don't run patman when it is imported as a module
Commit 488d19c (patman: add distutils based installer) has the side effect of making patman run twice with each invocation. Fix this by checking for 'main program' invocation in This is good practice in any case. Signed-off-by: Simon Glass <> Reviewed-by: Chris Packham <>
Diffstat (limited to 'tools')
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/patman/ b/tools/patman/
index e76fc42dd1..6fe8fe068c 100755
--- a/tools/patman/
+++ b/tools/patman/
@@ -74,8 +74,11 @@ specified by tags you place in the commits. Use -n to do a dry run first."""
settings.Setup(parser, options.project, '')
(options, args) = parser.parse_args()
+if __name__ != "__main__":
+ pass
# Run our meagre tests
-if options.test:
+elif options.test:
import doctest
sys.argv = [sys.argv[0]]
OpenPOWER on IntegriCloud