commit | 9ae3f7a189e3d05bf14835e9e2b8aff77661c1ba | [log] [tgz] |
---|---|---|
author | Martin v. Löwis <martin@v.loewis.de> | Mon Jul 09 20:46:11 2012 +0200 |
committer | Martin v. Löwis <martin@v.loewis.de> | Mon Jul 09 20:46:11 2012 +0200 |
tree | 78266cb61e0dac843553c40327ef03dbe166107d | |
parent | 44dea9d03f58c2c53f3547f89ad50a864ba8b455 [diff] [blame] |
Issue #13532: Check that arguments to sys.stdout.write are strings.
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 @@ 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):