py3: Avoid indexing exception objects

It doesn't work on Python 3.
This commit is contained in:
Stein Magnus Jodal 2014-12-07 20:26:07 +01:00
parent e35a066d5e
commit 7a1bb224f7

View File

@ -13,7 +13,7 @@ class MpdExceptionsTest(unittest.TestCase):
try:
raise KeyError('Track X not found')
except KeyError as e:
raise MpdAckError(e[0])
raise MpdAckError(e.message)
except MpdAckError as e:
self.assertEqual(e.message, 'Track X not found')