summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylanaraps@users.noreply.github.com>2017-09-25 08:42:35 +1000
committerGitHub <noreply@github.com>2017-09-25 08:42:35 +1000
commit637e31e9a862280db4c2e07ae6c62dbcc4069ee2 (patch)
tree28fe37fed0351b335f9af0b3a09a33173792bca3
parent9a34ee610bd864d39de49dc456078c7f335fc005 (diff)
parentf2db75cea99e8376457c610da06a0a583503e595 (diff)
Merge pull request #111 from linuxunil/master
Use run instead of popen so that things are closed correctly
-rw-r--r--pywal/colors.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pywal/colors.py b/pywal/colors.py
index 9984b6e..4ed4b4b 100644
--- a/pywal/colors.py
+++ b/pywal/colors.py
@@ -18,12 +18,12 @@ def imagemagick(color_count, img):
else:
magick_command = ["convert"]
- colors = subprocess.Popen([*magick_command, img, "-resize", "25%",
- "+dither", "-colors", str(color_count),
- "-unique-colors", "txt:-"],
- stdout=subprocess.PIPE)
+ colors = subprocess.run([*magick_command, img, "-resize", "25%",
+ "+dither", "-colors", str(color_count),
+ "-unique-colors", "txt:-"],
+ stdout=subprocess.PIPE)
- return colors.stdout.readlines()
+ return colors.stdout.splitlines()
def gen_colors(img, color_count):