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>
import copy
import glob
import os
+import pathlib
import struct
import unittest
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 = '''/*
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)