зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1245953 - Use requests for performing HTTP request; r=garndt
requests should *always* be used for performing HTTP requests because it has a better API *and* has sane security defaults compared to the HTTP request APIs in the Python standard library. Although, Python 2.7.9+ does have slightly saner defaults in the standard library. I still trust requests more. MozReview-Commit-ID: GqohpfYYGBw --HG-- extra : rebase_source : e6850a80818d73205a22ea4ba92be9e0ec43a473
This commit is contained in:
Родитель
390db245b5
Коммит
0227eca3bb
|
@ -152,10 +152,10 @@ def query_vcs_info(repository, revision):
|
|||
PushInfo = namedtuple('PushInfo', ['pushid', 'pushdate'])
|
||||
|
||||
try:
|
||||
import urllib2
|
||||
import requests
|
||||
url = '%s/json-pushes?changeset=%s' % (repository, revision)
|
||||
sys.stderr.write("Querying URL for pushdate: %s\n" % url)
|
||||
contents = json.load(urllib2.urlopen(url))
|
||||
contents = requests.get(url).json()
|
||||
|
||||
# The contents should be something like:
|
||||
# {
|
||||
|
|
Загрузка…
Ссылка в новой задаче