File tree 2 files changed +10
-1
lines changed
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):
1698
1698
"""Files are equal if they have the same checksum, only in read mode"""
1699
1699
if self is other :
1700
1700
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
+ )
1702
1707
1703
1708
def commit (self ):
1704
1709
"""Move from temp to final destination"""
Original file line number Diff line number Diff line change @@ -819,6 +819,10 @@ def test_eq():
819
819
result = fs == 1
820
820
assert result is False
821
821
822
+ f = AbstractBufferedFile (fs , "misc/foo.txt" , cache_type = "bytes" )
823
+ result = f == 1
824
+ assert result is False
825
+
822
826
823
827
def test_pickle_multiple ():
824
828
a = DummyTestFS (1 )
You can’t perform that action at this time.
0 commit comments