Drop support for retired Python 3.5

Upgrade syntax using `pyupgrade --py36-plus` .

Manually drop several `six` imports.

Also:
- Remove broken pr_cache in scripts/bootstrap_history.py
- Fix broken prefix removal in lib/galaxy/tool_util/deps/mulled/mulled_build.py
This commit is contained in:
Nicola Soranzo
2020-10-07 11:52:13 +01:00
parent 57d6a3857d
commit 9d74bba7fb
622 changed files with 1918 additions and 2175 deletions
+8 -7
View File
@@ -1,14 +1,15 @@
"""
Common methods used by the API sample scripts.
"""
from __future__ import print_function
import json
import logging
import sys
from six.moves.urllib.error import HTTPError
from six.moves.urllib.request import Request, urlopen
from urllib.error import HTTPError
from urllib.request import (
Request,
urlopen,
)
log = logging.getLogger(__name__)
@@ -92,7 +93,7 @@ def display(api_key, url, return_formatted=True):
if 'name' in i:
print(' name: %s' % i.pop('name'))
for k, v in i.items():
print(' %s: %s' % (k, v))
print(f' {k}: {v}')
print('')
print('%d element(s) in collection' % len(r))
elif type(r) == dict:
@@ -100,7 +101,7 @@ def display(api_key, url, return_formatted=True):
print('Member Information')
print('------------------')
for k, v in r.items():
print('%s: %s' % (k, v))
print(f'{k}: {v}')
elif type(r) == str:
print(r)
else:
@@ -137,7 +138,7 @@ def submit(api_key, url, data, return_formatted=True):
if 'name' in i:
print(' name: %s' % i.pop('name'))
for k, v in i.items():
print(' %s: %s' % (k, v))
print(f' {k}: {v}')
else:
print(i)
else: