Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: tools/valgrind/memcheck_analyze.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/valgrind/memcheck_analyze.py
diff --git a/tools/valgrind/memcheck_analyze.py b/tools/valgrind/memcheck_analyze.py
index c967281e02b072860d4681f5292ee9db3e158142..b934f35282d9868d3e9eb98929e827db54395d28 100755
--- a/tools/valgrind/memcheck_analyze.py
+++ b/tools/valgrind/memcheck_analyze.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -606,9 +606,9 @@ class MemcheckAnalyzer:
logging.info("PASS! No errors found!")
return 0
+
def _main():
'''For testing only. The MemcheckAnalyzer class should be imported instead.'''
- retcode = 0
parser = optparse.OptionParser("usage: %prog [options] <files to analyze>")
parser.add_option("", "--source_dir",
help="path to top of source tree for this build"
@@ -620,9 +620,8 @@ def _main():
filenames = args
analyzer = MemcheckAnalyzer(options.source_dir, use_gdb=True)
- retcode = analyzer.Report(filenames, None)
+ return analyzer.Report(filenames, None)
- sys.exit(retcode)
if __name__ == "__main__":
- _main()
+ sys.exit(_main())

Powered by Google App Engine
This is Rietveld 408576698