summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/font.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-08-08 05:42:54 (GMT)
committerGitHub <noreply@github.com>2019-08-08 05:42:54 (GMT)
commit662db125cddbca1db68116c547c290eb3943d98e (patch)
tree06151487dbe4493ef173dd8cc378f4b6cf5c0e4a /Lib/tkinter/font.py
parent4c69be22df3852f17873a74d015528d9a8ae92d6 (diff)
downloadcpython-662db125cddbca1db68116c547c290eb3943d98e.zip
cpython-662db125cddbca1db68116c547c290eb3943d98e.tar.gz
cpython-662db125cddbca1db68116c547c290eb3943d98e.tar.bz2
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/font.py')
-rw-r--r--Lib/tkinter/font.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/tkinter/font.py b/Lib/tkinter/font.py
index eeff454..15ad7ab 100644
--- a/Lib/tkinter/font.py
+++ b/Lib/tkinter/font.py
@@ -101,7 +101,9 @@ class Font:
return self.name
def __eq__(self, other):
- return isinstance(other, Font) and self.name == other.name
+ if not isinstance(other, Font):
+ return NotImplemented
+ return self.name == other.name
def __getitem__(self, key):
return self.cget(key)