diff Lib/idlelib/PyShell.py @ 78036:58189e37331c 2.7

- Issue #13532: Check that arguments to sys.stdout.write are strings.
author Martin v. Löwis <martin@v.loewis.de>
date Mon, 09 Jul 2012 21:01:49 +0200
parents 1a4e99460438
children 2993f566c82e
line wrap: on
line diff
--- a/Lib/idlelib/PyShell.py	Sun Jul 08 17:35:26 2012 -0400
+++ b/Lib/idlelib/PyShell.py	Mon Jul 09 21:01:49 2012 +0200
@@ -1265,6 +1265,8 @@
         self.encoding = encoding
 
     def write(self, s):
+        if not isinstance(s, str):
+            raise TypeError('must be str, not ' + type(s).__name__)
         self.shell.write(s, self.tags)
 
     def writelines(self, lines):