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:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user