X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/fdaab163072cb27edfef3bd00272449cfa618179..cc9b49c77b30bf4f8aed8fd84d73c49017615a9e:/tasklib/task.py diff --git a/tasklib/task.py b/tasklib/task.py index e346f67..0546e44 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -254,7 +254,10 @@ class TaskWarrior(object): stderr=subprocess.PIPE) stdout, stderr = p.communicate() if p.returncode: - error_msg = stderr.strip().splitlines()[-1] + if stderr.strip(): + error_msg = stderr.strip().splitlines()[-1] + else: + error_msg = stdout.strip() raise TaskWarriorException(error_msg) return stdout.strip().split('\n')