Allow str8 in .write().

This commit is contained in:
Martin v. Löwis 2007-08-13 06:26:48 +00:00
parent 98ff898c46
commit 0f98d8f8ea
1 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,8 @@ class OutputWindow(EditorWindow):
# Act as output file # Act as output file
def write(self, s, tags=(), mark="insert"): def write(self, s, tags=(), mark="insert"):
assert isinstance(s, str), repr(s) if isinstance(s, (bytes, str8)):
s = s.decode(IOBinding.encoding, "replace")
self.text.insert(mark, s, tags) self.text.insert(mark, s, tags)
self.text.see(mark) self.text.see(mark)
self.text.update() self.text.update()