7 lldb_root
= os
.path
.realpath(
8 os
.path
.dirname(inspect
.getfile(inspect
.currentframe()))
11 parent
= os
.path
.dirname(lldb_root
)
12 if parent
== lldb_root
: # dirname('/') == '/'
13 raise Exception("use_lldb_suite_root.py not found")
16 test_path
= os
.path
.join(lldb_root
, "use_lldb_suite_root.py")
17 if os
.path
.isfile(test_path
):
21 lldb_root
= find_lldb_root()
23 import importlib
.machinery
26 path
= os
.path
.join(lldb_root
, "use_lldb_suite_root.py")
27 loader
= importlib
.machinery
.SourceFileLoader("use_lldb_suite_root", path
)
28 spec
= importlib
.util
.spec_from_loader("use_lldb_suite_root", loader
=loader
)
29 module
= importlib
.util
.module_from_spec(spec
)
30 loader
.exec_module(module
)