From: Michael Tremer Date: Sun, 12 Dec 2010 20:16:49 +0000 (+0100) Subject: Fix error if no USB subsystem is available. X-Git-Tag: v0.11~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94700953460510d2ee7afe9ae59623dc2c750243;p=oddments%2Ffireinfo.git Fix error if no USB subsystem is available. --- diff --git a/fireinfo/system.py b/fireinfo/system.py index 01c1990..ce0efc7 100644 --- a/fireinfo/system.py +++ b/fireinfo/system.py @@ -303,6 +303,9 @@ class System(object): toscan = (("/sys/bus/pci/devices", device.PCIDevice), ("/sys/bus/usb/devices", device.USBDevice)) for path, cls in toscan: + if not os.path.exists(path): + continue + dirlist = os.listdir(path) for dir in dirlist: self.devices.append(cls(os.path.join(path, dir)))