Skip to content
Merged
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
7 changes: 5 additions & 2 deletions leads/comm/prototype.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import abstractmethod as _abstractmethod, ABCMeta as _ABCMeta
from socket import socket as _socket, AF_INET as _AF_INET, SOCK_STREAM as _SOCK_STREAM, \
gethostbyname_ex as _gethostbyname_ex, gethostname as _gethostname
gethostbyname_ex as _gethostbyname_ex, gethostname as _gethostname, gaierror as _gaierror
from threading import Lock as _Lock, Thread as _Thread
from typing import Self as _Self, Callable as _Callable, override as _override

Expand All @@ -9,7 +9,10 @@


def my_ip_addresses() -> list[str]:
return [ip for ip in _gethostbyname_ex(_gethostname())[2] if not ip.startswith("127.")]
try:
return [ip for ip in _gethostbyname_ex(_gethostname())[2] if not ip.startswith("127.")]
except _gaierror:
return []


class Service(metaclass=_ABCMeta):
Expand Down