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

Unified Diff: depot_tools/win_toolchain/toolchain2013.py

Issue 136793018: Fix presubmit errors in toolchain2013, so that cq works for depot_tools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 6 years, 11 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: depot_tools/win_toolchain/toolchain2013.py
===================================================================
--- depot_tools/win_toolchain/toolchain2013.py (revision 245069)
+++ depot_tools/win_toolchain/toolchain2013.py (working copy)
@@ -37,7 +37,6 @@
"""Generates a temporary directory (for downloading or extracting to) and keep
track of the directory that's created for cleaning up later.
"""
- global g_temp_dirs
temp = tempfile.mkdtemp()
g_temp_dirs.append(temp)
return temp
@@ -77,13 +76,13 @@
content_length = int(req.headers.get('Content-Length', 0))
bytes_read = 0L
terminator = '\r' if sys.stdout.isatty() else '\n'
- with open(local_path, 'wb') as file:
+ with open(local_path, 'wb') as file_handle:
while True:
chunk = req.read(1024 * 1024)
if not chunk:
break
bytes_read += len(chunk)
- file.write(chunk)
+ file_handle.write(chunk)
sys.stdout.write('... %d/%d%s' % (bytes_read, content_length, terminator))
sys.stdout.flush()
sys.stdout.write('\n')
@@ -181,7 +180,7 @@
}
matches = []
for extracted_dir in extracted_dirs:
- for root, dirnames, filenames in os.walk(extracted_dir):
+ for root, _, filenames in os.walk(extracted_dir):
for filename in filenames:
matches.append((extracted_dir, os.path.join(root, filename)))
@@ -265,7 +264,7 @@
help='use downloaded files from DIR')
parser.add_option('--express',
help='use VS Express instead of Pro', action='store_true')
- options, args = parser.parse_args()
+ options, _ = parser.parse_args()
try:
target_dir = os.path.abspath(options.targetdir)
if os.path.exists(target_dir):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698