From c7901243cf8759d4b812aeec15574a09840699a8 Mon Sep 17 00:00:00 2001 From: Vladimir Poleh Date: Tue, 2 Nov 2021 05:51:41 +0300 Subject: [PATCH] Fix Network panel not functioning when Wi-Fi point is within range (#304) (#315) --- panels/network.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/panels/network.py b/panels/network.py index e6ce32e8..ac0a1f18 100644 --- a/panels/network.py +++ b/panels/network.py @@ -33,8 +33,11 @@ class NetworkPanel(ScreenPanel): else: ints = netifaces.interfaces() if 'lo' in ints: - ints.pop('lo') - self.interfaces = ints[0] + ints.pop(ints.index('lo')) + if (len(ints) > 0): + self.interface = ints[0] + else: + self.interface = 'lo' res = netifaces.ifaddresses(self.interface) if netifaces.AF_INET in res and len(res[netifaces.AF_INET]) > 0: