summaryrefslogtreecommitdiffstats
path: root/Lib/plistlib.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-01 10:36:16 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-01 10:36:16 (GMT)
commitdd1bcdf6187ff18fb1536a6190926b0f03336186 (patch)
treea4f0e724cca0ccb121240205541ab27857b90385 /Lib/plistlib.py
parentf5f37d784b4e3f0362291cad6155a19cdfffcb57 (diff)
downloadcpython-dd1bcdf6187ff18fb1536a6190926b0f03336186.zip
cpython-dd1bcdf6187ff18fb1536a6190926b0f03336186.tar.gz
cpython-dd1bcdf6187ff18fb1536a6190926b0f03336186.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))