replace some typing.* constructs with native ones
This commit is contained in:
@@ -2,7 +2,6 @@ from __future__ import annotations
|
||||
|
||||
import ipaddress
|
||||
import sys
|
||||
import typing
|
||||
|
||||
import trio
|
||||
|
||||
@@ -12,7 +11,7 @@ import capport.utils.nft_set
|
||||
from . import cptypes
|
||||
|
||||
|
||||
def print_metric(name: str, mtype: str, value, *, now: typing.Optional[int] = None, help: typing.Optional[str] = None):
|
||||
def print_metric(name: str, mtype: str, value, *, now: int | None = None, help: str | None = None):
|
||||
# no labels in our names for now, always print help and type
|
||||
if help:
|
||||
print(f'# HELP {name} {help}')
|
||||
@@ -25,11 +24,11 @@ def print_metric(name: str, mtype: str, value, *, now: typing.Optional[int] = No
|
||||
|
||||
async def amain(client_ifname: str):
|
||||
ns = capport.utils.nft_set.NftSet()
|
||||
captive_allowed_entries: typing.Set[cptypes.MacAddress] = {
|
||||
captive_allowed_entries: set[cptypes.MacAddress] = {
|
||||
entry['mac']
|
||||
for entry in ns.list()
|
||||
}
|
||||
seen_allowed_entries: typing.Set[cptypes.MacAddress] = set()
|
||||
seen_allowed_entries: set[cptypes.MacAddress] = set()
|
||||
total_ipv4 = 0
|
||||
total_ipv6 = 0
|
||||
unique_clients = set()
|
||||
|
||||
Reference in New Issue
Block a user