mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
- Issue #13532: Check that arguments to sys.stdout.write are strings.
This commit is contained in:
parent
45ed012433
commit
e8e4e1456c
3 changed files with 25 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue