From 7d64d5d42593fbd1eeb9aa97c5d3ce541a3c5006 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Mon, 24 Oct 2022 17:01:55 +0200 Subject: [PATCH] Allow comparing File with a string --- osc/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osc/core.py b/osc/core.py index 22544106..4fd6cc68 100644 --- a/osc/core.py +++ b/osc/core.py @@ -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