don't fail in xrandr_facts.py if nvidia-smi is not available

This commit is contained in:
Alexander Grothe 2017-11-22 11:47:44 +01:00
parent f302e4e06c
commit 9860f607a0
2 changed files with 6 additions and 0 deletions

View File

@ -4232,6 +4232,9 @@ def collect_nvidia_data():
universal_newlines=True)
except subprocess.CalledProcessError:
pass
except OSError:
# nvidia-smi is not installed
pass
else:
for row in csv.DictReader(data.splitlines(), delimiter=',', skipinitialspace=True):
name = row['name']

View File

@ -197,6 +197,9 @@ def collect_nvidia_data():
universal_newlines=True)
except subprocess.CalledProcessError:
pass
except OSError:
# nvidia-smi is not installed
pass
else:
for row in csv.DictReader(data.splitlines(), delimiter=',', skipinitialspace=True):
name = row['name']