File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1698,7 +1698,12 @@ def __eq__(self, other):
16981698 """Files are equal if they have the same checksum, only in read mode"""
16991699 if self is other :
17001700 return True
1701- return self .mode == "rb" and other .mode == "rb" and hash (self ) == hash (other )
1701+ return (
1702+ isinstance (other , type (self ))
1703+ and self .mode == "rb"
1704+ and other .mode == "rb"
1705+ and hash (self ) == hash (other )
1706+ )
17021707
17031708 def commit (self ):
17041709 """Move from temp to final destination"""
Original file line number Diff line number Diff line change @@ -819,6 +819,10 @@ def test_eq():
819819 result = fs == 1
820820 assert result is False
821821
822+ f = AbstractBufferedFile (fs , "misc/foo.txt" , cache_type = "bytes" )
823+ result = f == 1
824+ assert result is False
825+
822826
823827def test_pickle_multiple ():
824828 a = DummyTestFS (1 )
You can’t perform that action at this time.
0 commit comments