Issue #19481: print() of string subclass instance in IDLE no more hangs.

This commit is contained in:
Serhiy Storchaka 2013-12-10 10:05:19 +02:00
parent d860d5cf6d
commit 9df8a1c112
2 changed files with 10 additions and 2 deletions

View File

@ -1331,8 +1331,11 @@ class PseudoOutputFile(PseudoFile):
def write(self, s): def write(self, s):
if self.closed: if self.closed:
raise ValueError("write to closed file") raise ValueError("write to closed file")
if type(s) is not str:
if not isinstance(s, str): if not isinstance(s, str):
raise TypeError('must be str, not ' + type(s).__name__) raise TypeError('must be str, not ' + type(s).__name__)
# See issue #19481
s = str.__str__(s)
return self.shell.write(s, self.tags) return self.shell.write(s, self.tags)

View File

@ -106,6 +106,11 @@ Library
- Issue #19286: Directories in ``package_data`` are no longer added to - Issue #19286: Directories in ``package_data`` are no longer added to
the filelist, preventing failure outlined in the ticket. the filelist, preventing failure outlined in the ticket.
IDLE
----
- Issue #19481: print() of string subclass instance in IDLE no more hangs.
Tests Tests
----- -----