1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-24 15:12:31 +01:00

Make sure the /sys/class/net/whatever is actually a directory in

GetWiredInterfaces() (similar to the check in GetWireless)
This commit is contained in:
Robby Workman
2009-05-19 15:44:52 -05:00
parent d18c933cac
commit 51f46c40a1

View File

@@ -121,8 +121,9 @@ def GetWirelessInterfaces():
def GetWiredInterfaces():
""" Returns a list of wired interfaces on the system. """
basedir = '/sys/class/net/'
return [iface for iface in os.listdir(basedir) if not 'wireless'
in os.listdir(basedir + iface) and
return [iface for iface in os.listdir(basedir)
if os.path.isdir(basedir + iface) and not 'wireless'
in os.listdir(basedir + iface) and
open(basedir + iface + "/type").readlines()[0].strip() == "1"]
def NeedsExternalCalls():