diff options
author | Anton Khirnov <anton@khirnov.net> | 2010-11-17 21:55:26 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2010-11-17 21:55:26 +0100 |
commit | 7979253b4ddde0561094f214ac6efc6fc23e3720 (patch) | |
tree | aef3b1478fd473b03b402dcc2864cf49b9e0a6cf | |
parent | 5d0ee0a4b3573cebf19f207eeaaf05b44a9aab4e (diff) |
random_wallpaper: handle OSError raised by subprocess
-rwxr-xr-x | scripts/random_wallpaper.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/random_wallpaper.py b/scripts/random_wallpaper.py index 89105ec..fa9fd5d 100755 --- a/scripts/random_wallpaper.py +++ b/scripts/random_wallpaper.py @@ -48,13 +48,13 @@ if not os.path.isdir(os.path.expandvars('${FVWM_USERDIR}/tmp/')): sys.exit(-1) try: subprocess.check_call(['convert', os.path.join(d, f), '-resize', res, os.path.expandvars('${FVWM_USERDIR}/tmp/current_wall.png')]) -except subprocess.CalledProcessError: +except (subprocess.CalledProcessError, OSError): sys.stderr.write('Error resizing the wallpaper. Is Imagemagick installed?\n') sys.exit(-1) try: subprocess.check_call(['feh', '--bg-center', os.path.expandvars('${FVWM_USERDIR}/tmp/current_wall.png')]) -except subprocess.CalledProcessError: +except (subprocess.CalledProcessError, OSError): sys.stderr.write('Error setting the wallpaper. Is feh installed?\n') sys.exit(-1) |