From 5a1127bb3febae61322c01357ba806c3f1d2cf1e Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Wed, 13 Jan 2016 09:51:50 +0100 Subject: [PATCH] Simplify sorted exception --- patacrep/content/sorted.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patacrep/content/sorted.py b/patacrep/content/sorted.py index 277b722d..2bd4cc34 100755 --- a/patacrep/content/sorted.py +++ b/patacrep/content/sorted.py @@ -8,7 +8,7 @@ import logging import unidecode from patacrep import files -from patacrep.content import ContentError, EmptyContentList +from patacrep.content import ContentError from patacrep.content import process_content, validate_parser_argument from patacrep.content.song import OnlySongsError @@ -101,11 +101,11 @@ def parse(keyword, config, argument): try: songlist = process_content(argument.get('content'), config) except OnlySongsError as error: - return EmptyContentList(errors=[ContentError(keyword, ( + raise ContentError(keyword, ( "Content list of this keyword can be only songs (or content " "that result into songs), and the following are not:" + str(error.not_songs) - ))]) + )) return sorted(songlist, key=key_generator(sort)) CONTENT_PLUGINS = {'sorted': parse}