1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 01:46:13 +01:00

Allow comparing File with a string

This commit is contained in:
Daniel Mach 2022-10-24 17:01:55 +02:00
parent 55503e13ca
commit 7d64d5d425

View File

@ -266,6 +266,8 @@ class File:
return self.name
def __eq__(self, other):
if isinstance(other, str):
return self.name == other
self_data = (self.name, self.md5, self.size, self.mtime, self.skipped)
other_data = (other.name, other.md5, other.size, other.mtime, other.skipped)
return self_data == other_data