From fa443f2e5f487abef3780c9ce2ebfe6732a7ce04 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 19 Mar 2022 18:08:34 +0200 Subject: [PATCH] Strict PackageItem comparison --- platformio/package/meta.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/platformio/package/meta.py b/platformio/package/meta.py index da6ac64a..5458dd71 100644 --- a/platformio/package/meta.py +++ b/platformio/package/meta.py @@ -432,9 +432,13 @@ class PackageItem(object): ) def __eq__(self, other): - if not self.path or not other.path: - return self.path == other.path - return os.path.realpath(self.path) == os.path.realpath(other.path) + conds = [ + os.path.realpath(self.path) == os.path.realpath(other.path) + if self.path and other.path + else self.path == other.path, + self.metadata == other.metadata, + ] + return all(conds) def __hash__(self): return hash(os.path.realpath(self.path))