diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2012-07-09 18:46:11 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2012-07-09 18:46:11 (GMT) |
commit | 9ae3f7a189e3d05bf14835e9e2b8aff77661c1ba (patch) | |
tree | 78266cb61e0dac843553c40327ef03dbe166107d /Lib/idlelib/PyShell.py | |
parent | 44dea9d03f58c2c53f3547f89ad50a864ba8b455 (diff) | |
download | cpython-9ae3f7a189e3d05bf14835e9e2b8aff77661c1ba.zip cpython-9ae3f7a189e3d05bf14835e9e2b8aff77661c1ba.tar.gz cpython-9ae3f7a189e3d05bf14835e9e2b8aff77661c1ba.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.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 278f4f6..a25ca87 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -1242,6 +1242,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): |