From 430eab2cf0a974e74f89ddceecd8f1006463487b Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Wed, 16 Oct 2019 21:52:39 +0100 Subject: [PATCH] Switch to using check_call for hooks --- beetsplug/hook.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/beetsplug/hook.py b/beetsplug/hook.py index ac0c4acad..ff3968a6a 100644 --- a/beetsplug/hook.py +++ b/beetsplug/hook.py @@ -105,7 +105,10 @@ class HookPlugin(BeetsPlugin): u' '.join(command_pieces), event) try: - subprocess.Popen(command_pieces).wait() + subprocess.check_call(command_pieces) + except subprocess.CalledProcessError as exc: + self._log.error(u'hook for {0} exited with status {1}', + event, exc.returncode) except OSError as exc: self._log.error(u'hook for {0} failed: {1}', event, exc)