Skip to content

Commit 9b8fb8b

Browse files
committed
Update type annotations for get_host_by_name()
1 parent d2bafae commit 9b8fb8b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

adafruit_fona/adafruit_fona.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from simpleio import map_range
2828

2929
try:
30-
from typing import Optional, Tuple
30+
from typing import Optional, Tuple, Union, Literal
3131
from circuitpython_typing import ReadableBuffer
3232
from busio import UART
3333
from digitalio import DigitalInOut
@@ -595,7 +595,7 @@ def read_sms(self, sms_slot: int) -> Tuple[str, str]:
595595

596596
### Socket API (TCP, UDP) ###
597597

598-
def get_host_by_name(self, hostname: str) -> str:
598+
def get_host_by_name(self, hostname: str) -> Union[str, Literal[False]]:
599599
"""Converts a hostname to a packed 4-byte IP address.
600600
601601
:param str hostname: Destination server.
@@ -847,7 +847,6 @@ def _send_parse_reply(
847847
:param bytes send_data: Data to send to the module.
848848
:param bytes send_data: Data received by the FONA module.
849849
:param str divider: Separator
850-
851850
"""
852851
self._read_line()
853852
self._get_reply(send_data)

0 commit comments

Comments
 (0)