Revert "InvalidQueryError: resist to any query"

This reverts commit 9e5e7a28e5.
This commit is contained in:
Bruno Cauet 2015-03-01 14:52:31 +01:00
parent 9e5e7a28e5
commit 952081e5ed
2 changed files with 1 additions and 14 deletions

View file

@ -37,13 +37,7 @@ class InvalidQueryError(ParsingError):
def __init__(self, query, explanation):
if isinstance(query, list):
query = " ".join(query)
try:
message = "'{0}': {1}".format(query, explanation)
except UnicodeDecodeError:
# queries are unicode. however if for an unholy reason it's not
# the case, an InvalidQueryError may be raised -- and report it
# correctly than fail again here
message = "{0!r}: {1}".format(query, explanation)
message = "'{0}': {1}".format(query, explanation)
super(InvalidQueryError, self).__init__(message)

View file

@ -1195,13 +1195,6 @@ class ParseQueryTest(unittest.TestCase):
self.assertIsInstance(raised.exception,
beets.dbcore.query.ParsingError)
def test_parse_byte_string(self):
with self.assertRaises(beets.dbcore.InvalidQueryError) as raised:
beets.library.parse_query_string(b'f\xf2o', None)
self.assertIn("can't decode", unicode(raised.exception))
self.assertIsInstance(raised.exception,
beets.dbcore.query.ParsingError)
def suite():
return unittest.TestLoader().loadTestsFromName(__name__)