follow-up prev

fix #4078
This commit is contained in:
SomberNight 2018-09-04 16:42:08 +02:00
parent 7d84409628
commit 1ec71cbaca
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9

View file

@ -74,10 +74,11 @@ def _find_system_cameras():
devices = {} # Name -> device
if os.path.exists(device_root):
for device in os.listdir(device_root):
path = os.path.join(device_root, device, 'name')
try:
with open(os.path.join(device_root, device, 'name'), encoding='utf-8') as f:
with open(path, encoding='utf-8') as f:
name = f.read()
except IOError:
except Exception:
continue
name = name.strip('\n')
devices[name] = os.path.join("/dev", device)