pyupgrade --py37-plus **/*.py (#1445)

This commit is contained in:
Janosh Riebesell
2022-01-11 17:05:02 +01:00
committed by GitHub
parent 676908daca
commit 19f21a9453
20 changed files with 50 additions and 56 deletions

View File

@@ -80,7 +80,7 @@ class GapiTest(unittest.TestCase):
]
self.empty_items_response = {'items': []}
super(GapiTest, self).setUp()
super().setUp()
def test_call_returns_basic_200_response(self):
response = gapi.call(self.mock_service, self.mock_method_name)

View File

@@ -755,11 +755,11 @@ def doPrintCrosDevices():
cros['autoUpdateExpiration'])
row = {}
for attrib in cros:
if attrib not in set([
if attrib not in {
'kind', 'etag', 'tpmVersionInfo', 'recentUsers',
'activeTimeRanges', 'deviceFiles', 'cpuStatusReports',
'diskVolumeReports', 'systemRamFreeReports'
]):
}:
row[attrib] = cros[attrib]
if selectedLists.get('activeTimeRanges'):
timergs = cros.get('activeTimeRanges', [])

View File

@@ -299,7 +299,7 @@ def update():
def orgUnitPathQuery(path, checkSuspended):
query = "orgUnitPath='{0}'".format(path.replace(
query = "orgUnitPath='{}'".format(path.replace(
"'", "\\'")) if path != '/' else ''
if checkSuspended is not None:
query += f' isSuspended={checkSuspended}'

View File

@@ -504,9 +504,9 @@ def showReport():
purge_parameters = True
for event in events:
for item in event.get('parameters', []):
if set(item) == set(['value', 'name']):
if set(item) == {'value', 'name'}:
event[item['name']] = item['value']
elif set(item) == set(['intValue', 'name']):
elif set(item) == {'intValue', 'name'}:
if item['name'] in ['start_time', 'end_time']:
val = item.get('intValue')
if val is not None:
@@ -517,9 +517,9 @@ def showReport():
val-62135683200).isoformat()
else:
event[item['name']] = item['intValue']
elif set(item) == set(['boolValue', 'name']):
elif set(item) == {'boolValue', 'name'}:
event[item['name']] = item['boolValue']
elif set(item) == set(['multiValue', 'name']):
elif set(item) == {'multiValue', 'name'}:
event[item['name']] = ' '.join(item['multiValue'])
elif item['name'] == 'scope_data':
parts = {}

View File

@@ -790,7 +790,7 @@ def downloadExport():
done = False
while not done:
status, done = downloader.next_chunk()
sys.stdout.write(' Downloaded: {0:>7.2%}\r'.format(
sys.stdout.write(' Downloaded: {:>7.2%}\r'.format(
status.progress()))
sys.stdout.flush()
sys.stdout.write('\n Download complete. Flushing to disk...\n')