aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-02-23 18:18:16 -0700
committerSimon Glass <sjg@chromium.org>2023-03-08 11:40:49 -0800
commit1688d6ca0e0c665c909ec6cd30c2aa53445548f2 (patch)
treea826c5ccdaeb6afe39d76e8fb651c016aa5c9b65 /tools
parentb3f5474077d60a1886f4ebb329387c108eca22d4 (diff)
downloadu-boot-1688d6ca0e0c665c909ec6cd30c2aa53445548f2.zip
u-boot-1688d6ca0e0c665c909ec6cd30c2aa53445548f2.tar.gz
u-boot-1688d6ca0e0c665c909ec6cd30c2aa53445548f2.tar.bz2
dtoc: Use pathlib to find the test directory
Update this so that the directory being used is declared at the top of the file. Use pathlib as it seems to be more modern. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/dtoc/test_dtoc.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
index 0f544f9..597c93e 100755
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -13,6 +13,7 @@ import collections
import copy
import glob
import os
+import pathlib
import struct
import unittest
@@ -28,7 +29,8 @@ from dtoc.src_scan import get_compat_name
from u_boot_pylib import test_util
from u_boot_pylib import tools
-OUR_PATH = os.path.dirname(os.path.realpath(__file__))
+DTOC_DIR = pathlib.Path(__file__).parent
+TEST_DATA_DIR = DTOC_DIR / 'test/'
HEADER = '''/*
@@ -91,7 +93,7 @@ def get_dtb_file(dts_fname, capture_stderr=False):
Returns:
str: Filename of compiled file in output directory
"""
- return fdt_util.EnsureCompiled(os.path.join(OUR_PATH, 'test', dts_fname),
+ return fdt_util.EnsureCompiled(str(TEST_DATA_DIR / dts_fname),
capture_stderr=capture_stderr)