Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions zeroconf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import threading
import time
import warnings
from abc import abstractmethod
from collections import OrderedDict
from typing import Dict, Iterable, List, Optional, Union, cast
from typing import Any, Callable, Set, Tuple # noqa # used in type hints
Expand Down Expand Up @@ -382,10 +383,6 @@ class NamePartTooLongException(Error):
pass


class AbstractMethodException(Error):
pass


class BadTypeInNameException(Error):
pass

Expand Down Expand Up @@ -505,9 +502,9 @@ def __init__(self, name: str, type_: int, class_: int, ttl: Union[float, int]) -
self._expiration_time = self.get_expiration_time(_EXPIRE_FULL_TIME_PERCENT)
self._stale_time = self.get_expiration_time(_EXPIRE_STALE_TIME_PERCENT)

@abstractmethod
def __eq__(self, other: Any) -> bool:
"""Abstract method"""
raise AbstractMethodException

def __ne__(self, other: Any) -> bool:
"""Non-equality test"""
Expand Down Expand Up @@ -552,9 +549,9 @@ def reset_ttl(self, other: 'DNSRecord') -> None:
self._expiration_time = self.get_expiration_time(_EXPIRE_FULL_TIME_PERCENT)
self._stale_time = self.get_expiration_time(_EXPIRE_STALE_TIME_PERCENT)

@abstractmethod
def write(self, out: 'DNSOutgoing') -> None:
"""Abstract method"""
raise AbstractMethodException

def to_string(self, other: Union[bytes, str]) -> str:
"""String representation with additional information"""
Expand Down