Skip to content

Commit

Permalink
Added timeout to imagemagick (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
fquinner committed Nov 29, 2020
1 parent c36f4e4 commit f5dfd50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wsl_windows_toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ def create_windows_icon(icon,
if has_imagemagick:
logger.debug("Could not convert using python methods - falling back on imagemagick")
try:
subprocess.check_output(["convert", icon_path, png_file])
subprocess.check_output(["convert", icon_path, png_file], timeout=10)
logger.debug("Converted %s to %s using imagemagick", icon_path, png_file)
except subprocess.CalledProcessError:
except (subprocess.CalledProcessError, subprocess.TimeoutExpired):
logger.exception("Failed to create or find png file for %s - icon will not be available (%s: %s)",
icon_path, type(e).__name__, e)
png_file = None
Expand Down

0 comments on commit f5dfd50

Please sign in to comment.