File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -225,10 +225,10 @@ def asBase64(self, maxlinelength=76):
225225 def __eq__ (self , other ):
226226 if isinstance (other , self .__class__ ):
227227 return self .data == other .data
228- elif isinstance (other , str ):
228+ elif isinstance (other , bytes ):
229229 return self .data == other
230230 else :
231- return id ( self ) == id ( other )
231+ return NotImplemented
232232
233233 def __repr__ (self ):
234234 return "%s(%s)" % (self .__class__ .__name__ , repr (self .data ))
Original file line number Diff line number Diff line change @@ -515,15 +515,15 @@ def test_dataobject_deprecated(self):
515515
516516 cur = plistlib .loads (buf )
517517 self .assertEqual (cur , out_data )
518- self .assertNotEqual (cur , in_data )
518+ self .assertEqual (cur , in_data )
519519
520520 cur = plistlib .loads (buf , use_builtin_types = False )
521- self .assertNotEqual (cur , out_data )
521+ self .assertEqual (cur , out_data )
522522 self .assertEqual (cur , in_data )
523523
524524 with self .assertWarns (DeprecationWarning ):
525525 cur = plistlib .readPlistFromBytes (buf )
526- self .assertNotEqual (cur , out_data )
526+ self .assertEqual (cur , out_data )
527527 self .assertEqual (cur , in_data )
528528
529529
Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ Core and Builtins
107107Library
108108-------
109109
110+ - Issue #26711: Fixed the comparison of plistlib.Data with other types.
111+
110112- Issue #24114: Fix an uninitialized variable in `ctypes.util`.
111113
112114 The bug only occurs on SunOS when the ctypes implementation searches
You can’t perform that action at this time.
0 commit comments