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

Side by Side Diff: tools/testrunner/local/utils.py

Issue 1220333004: [test] Turn off certificate verification when downloading test data on windows. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 return GuessOS() == 'windows' 119 return GuessOS() == 'windows'
120 120
121 121
122 def URLRetrieve(source, destination): 122 def URLRetrieve(source, destination):
123 """urllib is broken for SSL connections via a proxy therefore we 123 """urllib is broken for SSL connections via a proxy therefore we
124 can't use urllib.urlretrieve().""" 124 can't use urllib.urlretrieve()."""
125 if IsWindows(): 125 if IsWindows():
126 try: 126 try:
127 # In python 2.7.6 on windows, urlopen has a problem with redirects. 127 # In python 2.7.6 on windows, urlopen has a problem with redirects.
128 # Try using curl instead. Note, this is fixed in 2.7.8. 128 # Try using curl instead. Note, this is fixed in 2.7.8.
129 subprocess.check_call(["curl", source, '-L', '-o', destination]) 129 subprocess.check_call(["curl", source, '-k', '-L', '-o', destination])
130 return 130 return
131 except: 131 except:
132 # If there's no curl, fall back to urlopen. 132 # If there's no curl, fall back to urlopen.
133 print "Curl is currently not installed. Falling back to python." 133 print "Curl is currently not installed. Falling back to python."
134 pass 134 pass
135 with open(destination, 'w') as f: 135 with open(destination, 'w') as f:
136 f.write(urllib2.urlopen(source).read()) 136 f.write(urllib2.urlopen(source).read())
OLDNEW
« 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