mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
Issue #19481: print() of string subclass instance in IDLE no more hangs.
This commit is contained in:
commit
0ed6c4ae62
2 changed files with 10 additions and 2 deletions
|
|
@ -1334,8 +1334,11 @@ def writable(self):
|
|||
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)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -128,6 +128,11 @@ Library
|
|||
- Issue #19545: Avoid chained exceptions while passing stray % to
|
||||
time.strptime(). Initial patch by Claudiu Popa.
|
||||
|
||||
IDLE
|
||||
----
|
||||
|
||||
- Issue #19481: print() of string subclass instance in IDLE no more hangs.
|
||||
|
||||
Tests
|
||||
-----
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue