Merge "Fix create_pygmentize_bundle"

This commit is contained in:
jenkins-bot 2019-02-07 02:47:37 +00:00 committed by Gerrit Code Review
commit 71eaaa3639

View file

@ -30,13 +30,15 @@ PYGMENTIZE_LAUNCHER = textwrap.dedent('''\
print('Querying PyPI for the latest Pygments release...')
pypi = xmlrpc.client.ServerProxy('https://pypi.python.org/pypi')
latest_version = pypi.package_releases('Pygments')[0]
url = None
for release in pypi.release_urls('Pygments', latest_version):
if (release['packagetype'] == 'bdist_wheel' and
release['python_version'].startswith('py2')):
url = release['url']
md5_digest = release['md5_digest']
break
else:
if not url:
raise RuntimeError('No suitable package found.')
print('Retrieving version %s (%s)...' % (latest_version, url))