]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix `EventType` bases
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 22 Sep 2020 18:30:47 +0000 (11:30 -0700)
committerGitHub <noreply@github.com>
Tue, 22 Sep 2020 18:30:47 +0000 (11:30 -0700)
`StrEnum` does not exist in 3.8, so use original `(str, enum.Enum)` bases.

Lib/tkinter/__init__.py
Misc/NEWS.d/next/Library/2020-09-22-00-23-30.bpo-41817.bnh-VG.rst [new file with mode: 0644]

index 9d3bf4d49298f90afdb86bee4e51607f819594a3..479eb016da7f0a88d846c9584f7ed432a2c3f113 100644 (file)
@@ -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 (file)
index 0000000..6a634bb
--- /dev/null
@@ -0,0 +1 @@
+fix `tkinter.EventType` Enum so all members are strings, and none are tuples