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

Unified Diff: gsutil.py

Issue 809053002: gsutil: Use urllib2 instead of urllib. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years 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: gsutil.py
diff --git a/gsutil.py b/gsutil.py
index e3f50d4687cdc687832b48b33ff21bf7f1341f3a..d4649c8541719e220dab416ec8b0a979886e4cde 100755
--- a/gsutil.py
+++ b/gsutil.py
@@ -14,7 +14,7 @@ import base64
import os
import sys
import json
-import urllib
+import urllib2
import subprocess
@@ -67,7 +67,7 @@ def download_gsutil(version, target_dir):
local_md5 = md5_calc.hexdigest()
metadata_url = '%s%s' % (API_URL, filename)
- metadata = json.load(urllib.urlopen(metadata_url))
+ metadata = json.load(urllib2.urlopen(metadata_url))
remote_md5 = base64.b64decode(metadata['md5Hash'])
if local_md5 == remote_md5:
@@ -76,7 +76,7 @@ def download_gsutil(version, target_dir):
# Do the download.
url = '%s%s' % (GSUTIL_URL, filename)
- u = urllib.urlopen(url)
+ u = urllib2.urlopen(url)
with open(target_filename, 'wb') as f:
while True:
buf = u.read(4096)
« 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