testlib: have LogCapturer.raw() return unicode on 2.x.

pull/607/head
David Wilson 6 years ago
parent 46ebd56c7a
commit bf77d4ab1d

@ -283,7 +283,11 @@ class LogCapturer(object):
self.logger.level = logging.DEBUG
def raw(self):
return self.sio.getvalue()
s = self.sio.getvalue()
# Python 2.x logging package hard-wires UTF-8 output.
if isinstance(s, mitogen.core.BytesType):
s = s.decode('utf-8')
return s
def msgs(self):
return self.handler.msgs

Loading…
Cancel
Save