summaryrefslogtreecommitdiffstats
path: root/Tools
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 /Tools
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 'Tools')
-rw-r--r--Tools/pynche/PyncheWidget.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Tools/pynche/PyncheWidget.py b/Tools/pynche/PyncheWidget.py
index 364f22b..ef12198 100644
--- a/Tools/pynche/PyncheWidget.py
+++ b/Tools/pynche/PyncheWidget.py
@@ -281,10 +281,14 @@ class PopupViewer:
self.__window.deiconify()
def __eq__(self, other):
- return self.__menutext == other.__menutext
+ if isinstance(self, PopupViewer):
+ return self.__menutext == other.__menutext
+ return NotImplemented
def __lt__(self, other):
- return self.__menutext < other.__menutext
+ if isinstance(self, PopupViewer):
+ return self.__menutext < other.__menutext
+ return NotImplemented
def make_view_popups(switchboard, root, extrapath):