From 2eded80a9b031878abe3b1ae2aa299605ba81436 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Wed, 23 Jan 2013 21:20:27 +0100 Subject: [PATCH] Make sure we don't die if the kernel doesn't support some socket family --- wicd/wnettools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index cfd00c2..7227304 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -148,7 +148,10 @@ def isWireless(devname): we = None for t in [socket.AF_INET, socket.AF_INET6, socket.AF_IPX, socket.AF_AX25, socket.AF_APPLETALK]: - sk = socket.socket(t, socket.SOCK_DGRAM) + try: + sk = socket.socket(t, socket.SOCK_DGRAM) + except socket.error: + sk = None if sk is None: continue skfd = sk.fileno()