diff options
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 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): |