From 3400e881d12054b5a1be1d5324d28b9568ca1ecd Mon Sep 17 00:00:00 2001 From: bskjon Date: Sat, 6 Jul 2024 23:56:45 +0200 Subject: [PATCH] Build types --- DynamicRoutingUpdater/NetworkAdapter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DynamicRoutingUpdater/NetworkAdapter.py b/DynamicRoutingUpdater/NetworkAdapter.py index 1878933..09bf4af 100644 --- a/DynamicRoutingUpdater/NetworkAdapter.py +++ b/DynamicRoutingUpdater/NetworkAdapter.py @@ -2,7 +2,7 @@ import re import netifaces from netaddr import IPAddress -from typing import Optional +from typing import List, Optional from .objects import IpData, Netstated import subprocess @@ -88,13 +88,13 @@ def getCidr(self, subnet: str) -> Optional[str]: - def parseNetstat(self, nic_name: str) -> list[Netstated]: + def parseNetstat(self, nic_name: str) -> List[Netstated]: netstat_out = subprocess.getoutput(f"netstat -r -n -e -4 | grep {nic_name}").split("\n") result = [s for s in netstat_out if s] if (len(result) == 0): return [] else: - entries: list[Netstated] = [] + entries: List[Netstated] = [] for line in result: try: columns = re.split(r'\s+', line)