pypi: fix valueless items

Fix checking for such an nvchecker.ini:

[logcat-color]
pypi =
This commit is contained in:
Chih-Hsuan Yen 2019-01-07 02:19:30 +08:00
parent ae011170af
commit b108d9624a
No known key found for this signature in database
GPG Key ID: 0453A6CA23C56315

View File

@ -1,18 +1,14 @@
# MIT licensed
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
from . import cmd, conf_cacheable_with_name, session
from . import conf_cacheable_with_name, session
get_cacheable_conf = conf_cacheable_with_name('pypi')
async def get_version(name, conf, **kwargs):
package = conf.get('pypi')
package = conf.get('pypi') or name
use_pre_release = conf.getboolean('use_pre_release', False)
headers = {
'Accept': 'application/json',
'User-Agent': 'lilydjwg/nvchecker',
}
url = 'https://pypi.org/pypi/{}/json'.format(package)
async with session.get(url) as res: