mirror of https://github.com/python/cpython
Issue #19481: print() of string subclass instance in IDLE no more hangs.
This commit is contained in:
parent
d860d5cf6d
commit
9df8a1c112
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue