def write(self, s):
if isinstance(s, basestring):<EOL><INDENT>b = s.encode(self.encoding)<EOL><DEDENT>count = super(SimplePty, self).write(b)<EOL>return count<EOL>
Write the unicode string ``s`` to the pseudoterminal.
        This intends to make tests a little less verbose.

        Returns the number of bytes written.