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

Unified Diff: chrome/tools/build/win/dependencies.py

Issue 8680018: Fix python scripts in src/chrome/ (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: chrome/tools/build/win/dependencies.py
diff --git a/chrome/tools/build/win/dependencies.py b/chrome/tools/build/win/dependencies.py
index 353c89cd7121652895c63a8b99b8c609ae149f7e..ed8bb7e764a8499e9684fbcebb1aec6b619c4f3b 100755
--- a/chrome/tools/build/win/dependencies.py
+++ b/chrome/tools/build/win/dependencies.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
# Copyright (c) 2006-2008 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.
@@ -40,6 +40,7 @@ def RunSystemCommand(cmd):
except:
raise Error("Failed to execute: " + cmd)
+
def RunDumpbin(binary_file):
"""Runs dumpbin and parses its output.
@@ -196,8 +197,19 @@ def VerifyDependents(pe_name, dependents, delay_loaded, list_file, verbose):
return max(deps_result, delayed_result)
-def main(options, args):
+def main():
# PE means portable executable. It's any .DLL, .EXE, .SYS, .AX, etc.
+ usage = "usage: %prog [options] input output"
+ option_parser = optparse.OptionParser(usage=usage)
+ option_parser.add_option("-d",
+ "--debug",
+ dest="debug",
+ action="store_true",
+ default=False,
+ help="Display debugging information")
+ options, args = option_parser.parse_args()
+ if len(args) != 2:
+ option_parser.error("Incorrect number of arguments")
pe_name = args[0]
deps_file = args[1]
dependents, delay_loaded = RunDumpbin(pe_name)
@@ -211,15 +223,4 @@ def main(options, args):
if '__main__' == __name__:
- usage = "usage: %prog [options] input output"
- option_parser = optparse.OptionParser(usage = usage)
- option_parser.add_option("-d",
- "--debug",
- dest="debug",
- action="store_true",
- default=False,
- help="Display debugging information")
- options, args = option_parser.parse_args()
- if len(args) != 2:
- option_parser.error("Incorrect number of arguments")
- sys.exit(main(options, args))
+ sys.exit(main())

Powered by Google App Engine
This is Rietveld 408576698