Skip to content

Commit

Permalink
fix(src): ensure PEP 484 compatibility (avoid implicit optional)
Browse files Browse the repository at this point in the history
  • Loading branch information
christgau committed Mar 4, 2023
1 parent 3f1db91 commit 1036ecd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wsdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 57,7 @@ class NetworkInterface:
_index: int
_scope: int

def __init__(self, name: str, scope: int, index: int = None) -> None:
def __init__(self, name: str, scope: int, index: int) -> None:
self._name = name
self._scope = scope
if index is not None:
Expand Down Expand Up @@ -414,7 414,7 @@ def cleanup(self):
pass

# shortcuts for building WSD responses
def add_endpoint_reference(self, parent: ElementTree.Element, endpoint: str = None) -> None:
def add_endpoint_reference(self, parent: ElementTree.Element, endpoint: Optional[str] = None) -> None:
epr = ElementTree.SubElement(parent, 'wsa:EndpointReference')
address = ElementTree.SubElement(epr, 'wsa:Address')
if endpoint is None:
Expand Down Expand Up @@ -735,7 735,7 @@ def teardown(self) -> None:
super().teardown()
self.remove_outdated_probes()

def handle_packet(self, msg: str, src: UdpAddress = None) -> None:
def handle_packet(self, msg: str, src: Optional[UdpAddress] = None) -> None:
self.handle_message(msg, src)

def handle_hello(self, header: ElementTree.Element, body: ElementTree.Element) -> Optional[WSDMessage]:
Expand Down

0 comments on commit 1036ecd

Please sign in to comment.