Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: utils.py

Issue 29340497: Noissue - Refactor code downloading and unpacking jsshell for better readability (Closed)
Patch Set: Created April 18, 2016, 12:34 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
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: utils.py
===================================================================
--- a/utils.py
+++ b/utils.py
@@ -48,9 +48,11 @@
if os.path.exists(path):
return path
+
+ with closing(urllib.urlopen(JSSHELL_URL % build)) as response:
+ data = response.read()
- with closing(urllib.urlopen(JSSHELL_URL % build)) as response, \
- zipfile.ZipFile(StringIO(response.read())) as zip:
+ with zipfile.ZipFile(StringIO(data)) as zip:
zip.extractall(shell_dir)
if not os.path.exists(path):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld