summaryrefslogtreecommitdiff
path: root/Lib/tkinter/__init__.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-08-08 08:42:54 +0300
committerGitHub <noreply@github.com>2019-08-08 08:42:54 +0300
commit662db125cddbca1db68116c547c290eb3943d98e (patch)
tree06151487dbe4493ef173dd8cc378f4b6cf5c0e4a /Lib/tkinter/__init__.py
parent4c69be22df3852f17873a74d015528d9a8ae92d6 (diff)
downloadcpython-git-662db125cddbca1db68116c547c290eb3943d98e.tar.gz
bpo-37685: Fixed __eq__, __lt__ etc implementations in some classes. (GH-14952)
They now return NotImplemented for unsupported type of the other operand.
Diffstat (limited to 'Lib/tkinter/__init__.py')
-rw-r--r--Lib/tkinter/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index 9626a2780d..9258484af5 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -484,6 +484,8 @@ class Variable:
Note: if the Variable's master matters to behavior
also compare self._master == other._master
"""
+ if not isinstance(other, Variable):
+ return NotImplemented
return self.__class__.__name__ == other.__class__.__name__ \
and self._name == other._name