commit | e8e4e1456c8c168b5d1b5065280a50b3b5cf394f | [log] [tgz] |
---|---|---|
author | Martin v. Löwis <martin@v.loewis.de> | Mon Jul 09 21:01:49 2012 +0200 |
committer | Martin v. Löwis <martin@v.loewis.de> | Mon Jul 09 21:01:49 2012 +0200 |
tree | 12ffcdb972cc181e17b7aa2ec183dec791c59493 | |
parent | 45ed012433443cc9d79729b91f01f4a5ffe28ba6 [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 fa2e150..14f062e 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py
@@ -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):