oeqa/sdk/rust: Fix file deletion for multilib SDKs

We need to use shutil.rmtree here since removedirs() only covers
directories. Make the exception for specific too to make errors
easier to catch.

(From OE-Core rev: 9d2a661e46123a2292f7887658e6fa54923dbcc0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2022-08-01 14:17:21 +01:00
parent b9223d27bd
commit 2ef7affa31

View 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)