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

Unified Diff: globals/get_browser_versions.py

Issue 4843664727605248: Issue 2576 - Use urllib instead urllib2 which isn't bundled with runserver.exe (Closed)
Patch Set: Created May 22, 2015, 2:29 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: globals/get_browser_versions.py
===================================================================
--- a/globals/get_browser_versions.py
+++ b/globals/get_browser_versions.py
@@ -2,7 +2,7 @@
import os
import sys
import json
-import urllib2
+import urllib
import errno
import logging
import time
@@ -32,7 +32,7 @@
def get_mozilla_version(product, origin_version, channel,
minor=False, subdomain='aus4', origin_build='-',
attribute='appVersion', platform='WINNT_x86-msvc'):
- response = urllib2.urlopen('https://%s.mozilla.org/update/3/%s/%s/%s/%s/en-US/%s/-/default/default/update.xml?force=1' % (
+ response = urllib.urlopen('https://%s.mozilla.org/update/3/%s/%s/%s/%s/en-US/%s/-/default/default/update.xml?force=1' % (
subdomain,
product,
origin_version,
@@ -94,7 +94,7 @@
return manifest.getAttribute('version').split('.')[0]
def get_chrome_versions():
- response = urllib2.urlopen(urllib2.Request('https://tools.google.com/service/update2', CHROME_UPDATE_XML))
+ response = urllib.urlopen('https://tools.google.com/service/update2', CHROME_UPDATE_XML)
try:
doc = minidom.parse(response)
finally:
@@ -109,7 +109,7 @@
BROWSERS['chrome'] = get_chrome_versions
def get_opera_version(channel):
- response = urllib2.urlopen('https://autoupdate.geo.opera.com/netinstaller/' + channel)
+ response = urllib.urlopen('https://autoupdate.geo.opera.com/netinstaller/' + channel)
try:
spec = json.load(response)
finally:
@@ -129,7 +129,7 @@
BROWSERS['opera'] = get_opera_versions
def get_yandex_version(suffix):
- response = urllib2.urlopen('https://api.browser.yandex.ru/update-info/browser/yandex%s/win-yandex.xml' % suffix)
+ response = urllib.urlopen('https://api.browser.yandex.ru/update-info/browser/yandex%s/win-yandex.xml' % suffix)
try:
doc = minidom.parse(response)
finally:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld