From bf6c528a3eb2955ca41c8bf2c3f9f93cf12b5784 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 19 Feb 2018 19:53:00 +0530 Subject: [PATCH] rmtree: Don't retry when the file is not found No need to pointlessly loop for several seconds in this case. --- mesonbuild/mesonlib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index 49bc6ed02..19c432230 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -876,6 +876,8 @@ def windows_proof_rmtree(f): try: shutil.rmtree(f) return + except FileNotFoundError: + return except (OSError, PermissionError): time.sleep(d) # Try one last time and throw if it fails.