diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-01 14:17:21 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-01 14:18:16 +0100 |
commit | 2ef7affa31b4496eb295d20c63a24ebaf992a0e3 (patch) | |
tree | 26995aa5ddc0ae417d04381a2632d7074ff00988 /meta/lib/oeqa | |
parent | b9223d27bdebd1356b3ece4c8735f561c947d47d (diff) | |
download | poky-2ef7affa31b4496eb295d20c63a24ebaf992a0e3.tar.gz |
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>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/sdk/cases/rust.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oeqa/sdk/cases/rust.py b/meta/lib/oeqa/sdk/cases/rust.py index c122b64d0c..1075d37b49 100644 --- a/meta/lib/oeqa/sdk/cases/rust.py +++ b/meta/lib/oeqa/sdk/cases/rust.py | |||
@@ -19,8 +19,8 @@ class RustCompileTest(OESDKTestCase): | |||
19 | def setUpClass(self): | 19 | def setUpClass(self): |
20 | targetdir = os.path.join(self.tc.sdk_dir, "hello") | 20 | targetdir = os.path.join(self.tc.sdk_dir, "hello") |
21 | try: | 21 | try: |
22 | os.removedirs(targetdir) | 22 | shutil.rmtree(targetdir) |
23 | except OSError: | 23 | except FileNotFoundError: |
24 | pass | 24 | pass |
25 | shutil.copytree(os.path.join(self.tc.sdk_files_dir, "rust/hello"), targetdir) | 25 | shutil.copytree(os.path.join(self.tc.sdk_files_dir, "rust/hello"), targetdir) |
26 | 26 | ||