[Python-checkins] fix `EventType` bases

Miss Islington (bot) webhook-mailer at python.org
Tue Sep 22 14:31:26 EDT 2020


https://github.com/python/cpython/commit/b38ad227051d03e731a80db3942a729485262bd4
commit: b38ad227051d03e731a80db3942a729485262bd4
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-09-22T11:31:22-07:00
summary:

fix `EventType` bases


`StrEnum` does not exist in 3.8, so use original `(str, enum.Enum)` bases.

files:
A Misc/NEWS.d/next/Library/2020-09-22-00-23-30.bpo-41817.bnh-VG.rst
M Lib/tkinter/__init__.py

diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index 1067ab6a8b8a1..11ced6a3aff81 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -146,10 +146,10 @@ def _splitdict(tk, v, cut_minus=True, conv=None):
 
 class EventType(str, enum.Enum):
     KeyPress = '2'
-    Key = KeyPress,
+    Key = KeyPress
     KeyRelease = '3'
     ButtonPress = '4'
-    Button = ButtonPress,
+    Button = ButtonPress
     ButtonRelease = '5'
     Motion = '6'
     Enter = '7'
@@ -180,10 +180,10 @@ class EventType(str, enum.Enum):
     Colormap = '32'
     ClientMessage = '33'    # undocumented
     Mapping = '34'          # undocumented
-    VirtualEvent = '35',    # undocumented
-    Activate = '36',
-    Deactivate = '37',
-    MouseWheel = '38',
+    VirtualEvent = '35'     # undocumented
+    Activate = '36'
+    Deactivate = '37'
+    MouseWheel = '38'
 
     def __str__(self):
         return self.name
diff --git a/Misc/NEWS.d/next/Library/2020-09-22-00-23-30.bpo-41817.bnh-VG.rst b/Misc/NEWS.d/next/Library/2020-09-22-00-23-30.bpo-41817.bnh-VG.rst
new file mode 100644
index 0000000000000..6a634bb613260
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-09-22-00-23-30.bpo-41817.bnh-VG.rst
@@ -0,0 +1 @@
+fix `tkinter.EventType` Enum so all members are strings, and none are tuples



More information about the Python-checkins mailing list