Files
meta-openembedded/meta-python/recipes-devtools/python/python3-oletools/0001-tests-test_utils-utils.py-Adjust-source-code-dir.patch
T
Khem Raj a90647aadc *.patch: Fix malformed Upstream-Status tags
Bring Upstream-Status lines in line with the recipe style guide:

- Put Inappropriate reasons in brackets instead of parentheses or
  free text after the tag.
- Use the 'lastcommit:'/'lastrelease:' form for Inactive-Upstream.
- Mark patches that link an upstream pull request or mailing list post
  as Submitted rather than Pending.
- Mark patches described as OE or cross-build specific as Inappropriate
  rather than Pending.
- Drop meaningless qualifiers ('Pending [Unknown]', 'Submitted [Pending]')
  and duplicate Upstream-Status lines in the audiofile patches.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-11-17 21:49:49 -08:00

44 lines
1.6 KiB
Diff

From e387d7d7c1c3f22496e95def77889a6465ddff08 Mon Sep 17 00:00:00 2001
From: Leon Anavi <leon.anavi@konsulko.com>
Date: Tue, 14 Jul 2026 19:42:24 +0000
Subject: [PATCH] tests/test_utils/utils.py: Adjust source code dir
Fall back to the installed oletools location for the directory with
source code if the sibling "oletools" dir doesn't exist (e.g.
packaged/ptest installs).
Upstream-Status: Submitted [https://github.com/decalage2/oletools/pull/889]
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
tests/test_utils/utils.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/tests/test_utils/utils.py b/tests/test_utils/utils.py
index 45cedc8..c0f3aae 100644
--- a/tests/test_utils/utils.py
+++ b/tests/test_utils/utils.py
@@ -14,9 +14,16 @@ PROJECT_ROOT = dirname(dirname(dirname(abspath(__file__))))
# Directory with test data, independent of current working directory
DATA_BASE_DIR = join(PROJECT_ROOT, 'tests', 'test-data')
-# Directory with source code
-SOURCE_BASE_DIR = join(PROJECT_ROOT, 'oletools')
-
+# Fall back to the installed oletools location for the directory
+# with the source code if the sibling "oletools" dir doesn't exist
+_source_base_dir = join(PROJECT_ROOT, 'oletools')
+if not os.path.isdir(_source_base_dir):
+ try:
+ import oletools as _oletools
+ _source_base_dir = dirname(abspath(_oletools.__file__))
+ except ImportError:
+ pass
+SOURCE_BASE_DIR = _source_base_dir
def call_and_capture(module, args=None, accept_nonzero_exit=False,
exclude_stderr=False):
--
2.47.3