fix bitbucket source

This commit is contained in:
lilydjwg 2017-07-08 15:52:30 +08:00
parent f0f841db71
commit 774c36f4fe
1 changed files with 4 additions and 3 deletions

View File

@ -1,8 +1,7 @@
# MIT licensed # MIT licensed
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al. # Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
from aiohttp import request from . import session
from ..sortversion import sort_version_keys from ..sortversion import sort_version_keys
# doc: https://confluence.atlassian.com/display/BITBUCKET/commits+or+commit+Resource # doc: https://confluence.atlassian.com/display/BITBUCKET/commits+or+commit+Resource
@ -19,8 +18,10 @@ async def get_version(name, conf):
url = BITBUCKET_MAX_TAG % repo url = BITBUCKET_MAX_TAG % repo
else: else:
url = BITBUCKET_URL % (repo, br) url = BITBUCKET_URL % (repo, br)
async with request("GET", url) as res:
async with session.get(url) as res:
data = await res.json() data = await res.json()
if use_max_tag: if use_max_tag:
data = [tag for tag in data if tag not in ignored_tags] data = [tag for tag in data if tag not in ignored_tags]
data.sort(key=sort_version_key) data.sort(key=sort_version_key)