mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-36015: Handle StreamHandler representaton of stream with an integer name (GH-11908)
This commit is contained in:
parent
3918ad6b45
commit
ca87eebb22
2 changed files with 10 additions and 0 deletions
|
@ -1111,6 +1111,8 @@ class StreamHandler(Handler):
|
|||
def __repr__(self):
|
||||
level = getLevelName(self.level)
|
||||
name = getattr(self.stream, 'name', '')
|
||||
# bpo-36015: name can be an int
|
||||
name = str(name)
|
||||
if name:
|
||||
name += ' '
|
||||
return '<%s %s(%s)>' % (self.__class__.__name__, name, level)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue