summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-08-13 06:26:48 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-08-13 06:26:48 (GMT)
commit0f98d8f8ead113933b569f2fce74229e4561f9cf (patch)
tree111b8ce3047c9c298a0553e0f832e3806ab7db86 /Lib
parent98ff898c4637208f28f862a64779c2ea3f4b809d (diff)
downloadcpython-0f98d8f8ead113933b569f2fce74229e4561f9cf.zip
cpython-0f98d8f8ead113933b569f2fce74229e4561f9cf.tar.gz
cpython-0f98d8f8ead113933b569f2fce74229e4561f9cf.tar.bz2
Allow str8 in .write().
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/OutputWindow.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/idlelib/OutputWindow.py b/Lib/idlelib/OutputWindow.py
index 83d5771..330da76 100644
--- a/Lib/idlelib/OutputWindow.py
+++ b/Lib/idlelib/OutputWindow.py
@@ -35,7 +35,8 @@ class OutputWindow(EditorWindow):
# Act as output file
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.see(mark)
self.text.update()