[FIX] hw_scanner: iterate on empty list

Avoid error None is not iterable when no device is connected
This commit is contained in:
Martin Trigaux 2017-05-24 17:27:52 +02:00
parent 7b0440d3f8
commit e40cad3560
No known key found for this signature in database
GPG Key ID: 7B0E288E7C0F83A7
1 changed files with 2 additions and 2 deletions

View File

@ -120,10 +120,10 @@ class Scanner(Thread):
def get_devices(self):
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]]