mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-41831: Restore str implementation of __str__ in tkinter.EventType (GH-22355)
This commit is contained in:
parent
f25323a307
commit
eb38c6b7aa
2 changed files with 5 additions and 3 deletions
|
@ -185,8 +185,7 @@ class EventType(enum.StrEnum):
|
|||
Deactivate = '37'
|
||||
MouseWheel = '38'
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
__str__ = str.__str__
|
||||
|
||||
|
||||
class Event:
|
||||
|
@ -266,7 +265,7 @@ class Event:
|
|||
'num', 'delta', 'focus',
|
||||
'x', 'y', 'width', 'height')
|
||||
return '<%s event%s>' % (
|
||||
self.type,
|
||||
getattr(self.type, 'name', self.type),
|
||||
''.join(' %s=%s' % (k, attrs[k]) for k in keys if k in attrs)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue