Bug 1712815 - Fix the 'remove a file from a moz.build file' logic r=jewilde

We were raising an exception as a result of a python error
which was masked by a catch statement that thought we didn't
know how to remove the file. But we did.

Fix the python error, and add an exception at the end of the
function to be raised and then caught when we really don't know
how to remove a file.

Differential Revision: https://phabricator.services.mozilla.com/D115936
This commit is contained in:
Tom Ritter 2021-05-27 14:19:25 +00:00
Родитель d9d050317e
Коммит 2b1afa9921
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -862,7 +862,8 @@ def remove_file_from_moz_build_file(
normalized_mozbuild_filename
)
for key, normalized_source_filename_list in source_assignments:
for key in source_assignments:
normalized_source_filename_list = source_assignments[key]
if normalized_filename_to_remove in normalized_source_filename_list:
unnormalized_filename_to_remove = unnormalize_filename(
normalized_mozbuild_filename, normalized_filename_to_remove
@ -873,6 +874,7 @@ def remove_file_from_moz_build_file(
return
normalized_filename_to_remove = original_normalized_filename_to_remove
raise Exception("Could not remove file")
def add_file_to_moz_build_file(