summaryrefslogtreecommitdiffstats
path: root/Lib/plistlib.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-01 10:36:42 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-01 10:36:42 (GMT)
commit47d1d7f48a841dc5539638c3941445d8507e6beb (patch)
treed8bea256ab2b21cc660aa31f5df74433f9f1a3ef /Lib/plistlib.py
parentb608196b20483ef69fab0383e61d3e53aed04ece (diff)
parentdd1bcdf6187ff18fb1536a6190926b0f03336186 (diff)
downloadcpython-47d1d7f48a841dc5539638c3941445d8507e6beb.zip
cpython-47d1d7f48a841dc5539638c3941445d8507e6beb.tar.gz
cpython-47d1d7f48a841dc5539638c3941445d8507e6beb.tar.bz2
Issue #26711: Fixed the comparison of plistlib.Data with other types.
Diffstat (limited to 'Lib/plistlib.py')
-rw-r--r--Lib/plistlib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/plistlib.py b/Lib/plistlib.py
index a39151f..b66639c 100644
--- a/Lib/plistlib.py
+++ b/Lib/plistlib.py
@@ -225,10 +225,10 @@ class Data:
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.data == other.data
- elif isinstance(other, str):
+ elif isinstance(other, bytes):
return self.data == other
else:
- return id(self) == id(other)
+ return NotImplemented
def __repr__(self):
return "%s(%s)" % (self.__class__.__name__, repr(self.data))