[FIX] hw_scanner: iterate on empty list
Avoid error None is not iterable when no device is connectedproduction/rebase-20171130
parent
7b0440d3f8
commit
e40cad3560
|
@ -120,10 +120,10 @@ class Scanner(Thread):
|
|||
def get_devices(self):
|
||||
try:
|
||||
if not evdev:
|
||||
return None
|
||||
return []
|
||||
|
||||
if not os.path.isdir(self.input_dir):
|
||||
return None
|
||||
return []
|
||||
|
||||
new_devices = [device for device in listdir(self.input_dir)
|
||||
if join(self.input_dir, device) not in [dev.evdev.fn for dev in self.open_devices]]
|
||||
|
|
Loading…
Reference in New Issue