scripts: kconfigfunctions: cleanup edt loading
An explicit import of edtlib is not required when using
pickle.load() and creates a duplicate module object.
Retrieve the correct module object directly from the pickle file
using inspect.getmodule().
Signed-off-by: Keith Short <keithshort@google.com>
diff --git a/scripts/kconfig/kconfigfunctions.py b/scripts/kconfig/kconfigfunctions.py
index ebec7f5..fc76d68 100644
--- a/scripts/kconfig/kconfigfunctions.py
+++ b/scripts/kconfig/kconfigfunctions.py
@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: Apache-2.0
+import inspect
import os
import pickle
import sys
@@ -12,8 +13,6 @@
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts", "dts",
"python-devicetree", "src"))
-from devicetree import edtlib
-
# Types we support
# 'string', 'int', 'hex', 'bool'
@@ -26,6 +25,7 @@
if EDT_PICKLE is not None and os.path.isfile(EDT_PICKLE):
with open(EDT_PICKLE, 'rb') as f:
edt = pickle.load(f)
+ edtlib = inspect.getmodule(edt)
else:
edt = None