]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/sdk/rust: Fix file deletion for multilib SDKs
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 1 Aug 2022 13:17:21 +0000 (14:17 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 1 Aug 2022 13:18:14 +0000 (14:18 +0100)
We need to use shutil.rmtree here since removedirs() only covers
directories. Make the exception for specific too to make errors
easier to catch.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/sdk/cases/rust.py

index c122b64d0c5eef75845a10f33e4d02a2e8793083..1075d37b49ebe3e9d604c9f2c00fbe414fa81b4f 100644 (file)
@@ -19,8 +19,8 @@ class RustCompileTest(OESDKTestCase):
     def setUpClass(self):
         targetdir = os.path.join(self.tc.sdk_dir, "hello")
         try:
-            os.removedirs(targetdir)
-        except OSError:
+            shutil.rmtree(targetdir)
+        except FileNotFoundError:
             pass
         shutil.copytree(os.path.join(self.tc.sdk_files_dir, "rust/hello"), targetdir)