From 093dc9088bfd251d422165708f2ab2cc4b740a38 Mon Sep 17 00:00:00 2001 From: Ignacio Calderon Date: Wed, 26 Jun 2024 15:37:29 +0200 Subject: [PATCH] fix tests --- pbxproj/pbxextensions/ProjectFiles.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pbxproj/pbxextensions/ProjectFiles.py b/pbxproj/pbxextensions/ProjectFiles.py index 817bf05..9057c8d 100644 --- a/pbxproj/pbxextensions/ProjectFiles.py +++ b/pbxproj/pbxextensions/ProjectFiles.py @@ -355,11 +355,8 @@ def remove_file_by_id(self, file_id, target_name=None): target.remove_build_phase(build_phase) # remove it iff it's removed from all targets or no build file reference it - if len([ - True - for x in self.objects.get_objects_in_section('PBXBuildFile') - if hasattr(x, 'fileRef') == file_ref.get_id() - ]) != 0: + if len([1 for x in self.objects.get_objects_in_section('PBXBuildFile') if + hasattr(x, 'fileRef') and x.fileRef == file_ref.get_id()]) != 0: return True # remove the file from any groups if there is no reference from any target