Replace lists with tuples (2) (#53685)

This commit is contained in:
Marc Mueller
2021-07-30 01:20:03 +02:00
committed by GitHub
parent 5eba3e485b
commit 0815eede4b
61 changed files with 137 additions and 139 deletions

View File

@ -414,20 +414,20 @@ def _update( # noqa: C901
err.pid,
err.name,
)
elif type_ in ["network_out", "network_in"]:
elif type_ in ("network_out", "network_in"):
counters = _net_io_counters()
if data.argument in counters:
counter = counters[data.argument][IO_COUNTER[type_]]
state = round(counter / 1024 ** 2, 1)
else:
state = None
elif type_ in ["packets_out", "packets_in"]:
elif type_ in ("packets_out", "packets_in"):
counters = _net_io_counters()
if data.argument in counters:
state = counters[data.argument][IO_COUNTER[type_]]
else:
state = None
elif type_ in ["throughput_network_out", "throughput_network_in"]:
elif type_ in ("throughput_network_out", "throughput_network_in"):
counters = _net_io_counters()
if data.argument in counters:
counter = counters[data.argument][IO_COUNTER[type_]]
@ -445,7 +445,7 @@ def _update( # noqa: C901
value = counter
else:
state = None
elif type_ in ["ipv4_address", "ipv6_address"]:
elif type_ in ("ipv4_address", "ipv6_address"):
addresses = _net_if_addrs()
if data.argument in addresses:
for addr in addresses[data.argument]: