Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/174'
Browse files Browse the repository at this point in the history
* origin/pr/174:
  Do not crash on unexpected output from xrandr
  • Loading branch information
marmarek committed Aug 4, 2021
2 parents 8a8db63 + 9594cb3 commit d0be4ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion qubesadmin/tools/qvm_start_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import subprocess
import fcntl
import asyncio
import logging
import re
import functools
import sys
Expand Down Expand Up @@ -278,7 +279,11 @@ def get_monitor_layout():
['xrandr', '-q'], stdout=subprocess.PIPE).stdout:
line = line.decode()
if not line.startswith("Screen") and not line.startswith(" "):
output_params = REGEX_OUTPUT.match(line).groupdict()
match = REGEX_OUTPUT.match(line)
if not match:
logging.warning('Invalid output from xrandr: %r', line)
continue
output_params = match.groupdict()
if output_params['width']:
phys_size = ""
if output_params['width_mm'] and int(output_params['width_mm']):
Expand Down

0 comments on commit d0be4ee

Please sign in to comment.