Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to netifaces-plus #1079

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions nowplaying/hostmeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
global HOSTIP #pylint: disable=global-statement
socket.setdefaulttimeout(5)
try:
gws = netifaces.gateways()
defnic = gws['default'][netifaces.AF_INET][1]
defnicipinfo = netifaces.ifaddresses(defnic).setdefault(netifaces.AF_INET, [{'addr': None}])
gws = netifaces.gateways() # pylint: disable=no-member
defnic = gws['default'][netifaces.AF_INET][1] # pylint: disable=no-member
defnicipinfo = netifaces.ifaddresses(defnic).setdefault(netifaces.AF_INET, [{'addr': None}]) # pylint: disable=no-member

Check warning on line 50 in nowplaying/hostmeta.py

View check run for this annotation

Codecov / codecov/patch

nowplaying/hostmeta.py#L48-L50

Added lines #L48 - L50 were not covered by tests
HOSTIP = defnicipinfo[0]['addr']
except Exception as error: # pylint: disable = broad-except
logging.error('Getting IP information via netifaces failed: %s', error)
Expand Down
4 changes: 2 additions & 2 deletions requirements-run.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ discord.py==2.3.2
diskcache==5.6.3
jinja2==3.1.4
lxml==5.3.0
netifaces==0.11.0
nltk==3.9.1
netifaces-plus==0.12.2
nltk==3.8.1
normality==2.5.0
pid==3.0.4
pillow==10.4.0
Expand Down
Loading