From 59b0e68625d89b50d91c5e450104ab180bc39100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 31 Dec 2024 13:29:38 +0100 Subject: [PATCH] chg: make mypy happy --- pymispwarninglists/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pymispwarninglists/api.py b/pymispwarninglists/api.py index 752a8ad..5f6e984 100644 --- a/pymispwarninglists/api.py +++ b/pymispwarninglists/api.py @@ -8,7 +8,7 @@ import sys from collections.abc import Mapping from contextlib import suppress from glob import glob -from ipaddress import ip_network, IPv6Address, IPv4Address, IPv4Network, _BaseNetwork, \ +from ipaddress import ip_network, IPv6Address, IPv4Address, IPv4Network, IPv6Network, \ AddressValueError, NetmaskValueError from pathlib import Path from typing import Union, Dict, Any, List, Optional, Tuple, Sequence @@ -172,7 +172,7 @@ class NetworkFilter: return ip in child - def append(self, net: _BaseNetwork) -> None: + def append(self, net: IPv4Network | IPv6Network) -> None: digit = self._get_digit(int(net.network_address)) if net.max_prefixlen - net.prefixlen == self.digit_position: @@ -211,7 +211,7 @@ def compile_network_filters(values: list) -> Tuple[NetworkFilter, NetworkFilter] return ipv4_filter, ipv6_filter -def convert_networks(values: list) -> Sequence[_BaseNetwork]: +def convert_networks(values: list) -> Sequence[IPv4Network | IPv6Network]: valid_ips = [] invalid_ips = []