From a86d0b143b53c8a0c7b7f094c2bb2e456b81af16 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 2 May 2017 14:28:30 +0200 Subject: [PATCH] Do not fail if the `kiwixlib/src/main` doesn't exist when deleting him. When deleting the directory, this is not a problem if the directory doesn't exist. --- dependencies.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dependencies.py b/dependencies.py index c75aac2..7cb58f8 100644 --- a/dependencies.py +++ b/dependencies.py @@ -357,5 +357,8 @@ class KiwixAndroid(Dependency): def _configure(self, context): if not os.path.exists(self.build_path): shutil.copytree(self.source_path, self.build_path) - shutil.rmtree(pj(self.build_path, 'kiwixlib', 'src', 'main')) + try: + shutil.rmtree(pj(self.build_path, 'kiwixlib', 'src', 'main')) + except FileNotFoundError: + pass shutil.copytree(pj(self.buildEnv.install_dir, 'kiwix-lib'), pj(self.build_path, 'kiwixlib', 'src', 'main'))