summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/PyShell.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2012-07-09 19:01:49 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2012-07-09 19:01:49 (GMT)
commite8e4e1456c8c168b5d1b5065280a50b3b5cf394f (patch)
tree12ffcdb972cc181e17b7aa2ec183dec791c59493 /Lib/idlelib/PyShell.py
parent45ed012433443cc9d79729b91f01f4a5ffe28ba6 (diff)
downloadcpython-e8e4e1456c8c168b5d1b5065280a50b3b5cf394f.zip
cpython-e8e4e1456c8c168b5d1b5065280a50b3b5cf394f.tar.gz
cpython-e8e4e1456c8c168b5d1b5065280a50b3b5cf394f.tar.bz2
- Issue #13532: Check that arguments to sys.stdout.write are strings.
Diffstat (limited to 'Lib/idlelib/PyShell.py')
-rw-r--r--Lib/idlelib/PyShell.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index fa2e150..14f062e 100644
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -1265,6 +1265,8 @@ class PseudoFile(object):
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):