def write(self, msg):
if self.redirect is not None:<EOL><INDENT>self.redirect.write(msg)<EOL><DEDENT>if six.PY2:<EOL><INDENT>from xdoctest.utils.util_str import ensure_unicode<EOL>msg = ensure_unicode(msg)<EOL><DEDENT>super(TeeStringIO, self).write(msg)<EOL>
Write to this and the redirected stream