Commit 9df8a1c1 authored by Serhiy Storchaka's avatar Serhiy Storchaka

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

parent d860d5cf
......@@ -1331,8 +1331,11 @@ class PseudoOutputFile(PseudoFile):
def write(self, s):
if self.closed:
raise ValueError("write to closed file")
if not isinstance(s, str):
raise TypeError('must be str, not ' + type(s).__name__)
if type(s) is not str:
if not isinstance(s, str):
raise TypeError('must be str, not ' + type(s).__name__)
# See issue #19481
s = str.__str__(s)
return self.shell.write(s, self.tags)
......
......@@ -106,6 +106,11 @@ Library
- Issue #19286: Directories in ``package_data`` are no longer added to
the filelist, preventing failure outlined in the ticket.
IDLE
----
- Issue #19481: print() of string subclass instance in IDLE no more hangs.
Tests
-----
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment