diff -r 7e2b389418da -r 7825f6154a65 contrib/check-code.py --- a/contrib/check-code.py Fri May 20 09:47:35 2016 +0900 +++ b/contrib/check-code.py Fri May 20 09:47:35 2016 +0900 @@ -622,7 +622,7 @@ return result -if __name__ == "__main__": +def main(): parser = optparse.OptionParser("%prog [options] [files]") parser.add_option("-w", "--warnings", action="store_true", help="include warning-level checks") @@ -650,4 +650,7 @@ blame=options.blame, debug=options.debug, lineno=options.lineno): ret = 1 - sys.exit(ret) + return ret + +if __name__ == "__main__": + sys.exit(main())