Skip to content
Snippets Groups Projects
Commit 62de2fb6 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

exceptions will now display correctly

parent 043ba8fc
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ class AMQPError(CoolAMQPError):
else:
reply_text = self.reply_text
if isinstance(self.reply_text, bytes):
if isinstance(reply_text, bytes):
reply_text = self.reply_text.decode('utf8')
return reply_text
......
......@@ -18,3 +18,7 @@ class TestExcs(unittest.TestCase):
e = AMQPError(100, memoryview(u'wtf'.encode('utf8')), 0, 0)
self.assertIn('wtf', str(e))
self.assertIn('wtf', repr(e))
e = AMQPError(100, u'wtf'.encode('utf8'), 0, 0)
self.assertIn('wtf', str(e))
self.assertIn('wtf', repr(e))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment