Skip to content

Commit

Permalink
[Fixed] Problems when recordmydesktop isn't installed
Browse files Browse the repository at this point in the history
- Now we print an error message and disable the recording
- So we don't fail and the user knows something went wrong and
  how to fix it.
  • Loading branch information
set-soft committed Aug 11, 2022
1 parent 6f425b9 commit f98fa70
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kiauto/ui_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ def start_x11vnc(do_it, old_display):

@contextmanager
def recorded_xvfb(cfg, num_try=0):
try:
old_display = os.environ['DISPLAY']
except KeyError:
old_display = None
old_display = os.environ.get('DISPLAY')
if cfg.record and shutil.which('recordmydesktop') is None:
logger.error('To record the session please install `recordmydesktop`')
cfg.record = False
with Xvfb(width=cfg.rec_width, height=cfg.rec_height, colordepth=cfg.colordepth):
wait_xserver(cfg.output_dir, num_try)
with start_x11vnc(cfg.start_x11vnc, old_display):
Expand Down

0 comments on commit f98fa70

Please sign in to comment.