Skip to content

Instantly share code, notes, and snippets.

@kranzo
Created August 9, 2021 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kranzo/83966cbb41df775406a38ece21122854 to your computer and use it in GitHub Desktop.
Save kranzo/83966cbb41df775406a38ece21122854 to your computer and use it in GitHub Desktop.
ignore errors while deleting paths which not exist
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py
index f92255d8dc..c08a47c3db 100644
--- a/scripts/lib/scriptutils.py
+++ b/scripts/lib/scriptutils.py
@@ -215,7 +215,7 @@ def fetch_url(tinfoil, srcuri, srcrev, destdir, logger, preserve_tmp=False, mirr
pathvars = ['T', 'RECIPE_SYSROOT', 'RECIPE_SYSROOT_NATIVE']
for pathvar in pathvars:
path = rd.getVar(pathvar)
- shutil.rmtree(path)
+ shutil.rmtree(path,ignore_errors=True)
finally:
if fetchrecipe:
try:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment