mirror of
https://github.com/beetbox/beets.git
synced 2026-02-24 16:23:04 +01:00
Revert "InvalidQueryError: resist to any query"
This reverts commit 9e5e7a28e5.
This commit is contained in:
parent
9e5e7a28e5
commit
952081e5ed
2 changed files with 1 additions and 14 deletions
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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__)
|
||||
|
|
|
|||
Loading…
Reference in a new issue