Index: git_cl.py |
diff --git a/git_cl.py b/git_cl.py |
index 143ad2854d00072877a7d42dd30908983f1d0145..03d773c2ebfa637716c15401129bb7d22cd0d240 100755 |
--- a/git_cl.py |
+++ b/git_cl.py |
@@ -16,7 +16,6 @@ import stat |
import sys |
import textwrap |
import urlparse |
-import urllib |
import urllib2 |
try: |
@@ -756,6 +755,11 @@ def LoadCodereviewSettingsFromFile(fileobj): |
keyvals['ORIGIN_URL_CONFIG']]) |
+def urlretrieve(source, destination): |
+ with open(destination, 'w+') as f: |
M-A Ruel
2012/08/01 13:57:21
Why more 'w+'? Please use 'w'
Also add a doctring
joshuagl
2012/08/01 18:50:20
Will do both of the above.
|
+ f.write(urllib2.urlopen(source).read()) |
+ |
+ |
def DownloadHooks(force): |
"""downloads hooks |
@@ -773,7 +777,7 @@ def DownloadHooks(force): |
return |
os.remove(dst) |
try: |
- urllib.urlretrieve(src, dst) |
+ urlretrieve(src, dst) |
os.chmod(dst, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) |
except Exception: |
if os.path.exists(dst): |