--- wicd/wnettools.py 2012-10-16 03:23:12.000000000 +0200 +++ ..orig/wicd/wnettools.py 2012-11-07 21:11:20.751956524 +0100 @@ -140,12 +140,13 @@ The first interface available. """ - dev_dir = '/sys/class/net/' - ifnames = [iface for iface in os.listdir(dev_dir) - if os.path.isdir(dev_dir + iface) and - 'wireless' in os.listdir(dev_dir + iface)] - - return ifnames + ieeepath = '/sys/class/ieee80211' + phys = [ phy for phy in os.listdir(ieeepath) ] + ifaces = list(set([ str(dev) for dev in os.listdir(os.path.join(ieeepath, phy, 'device/net')) for phy in phys ])) + if len(ifaces) < 1: + return None + else: + return ifaces[0] def GetWiredInterfaces(): """ Returns a list of wired interfaces on the system. """