7 lldb_root
= os
.path
.dirname(inspect
.getfile(inspect
.currentframe()))
9 parent
= os
.path
.dirname(lldb_root
)
10 if parent
== lldb_root
: # dirname('/') == '/'
11 raise Exception("use_lldb_suite_root.py not found")
14 test_path
= os
.path
.join(lldb_root
, "use_lldb_suite_root.py")
15 if os
.path
.isfile(test_path
):
19 lldb_root
= find_lldb_root()
21 import importlib
.machinery
24 path
= os
.path
.join(lldb_root
, "use_lldb_suite_root.py")
25 loader
= importlib
.machinery
.SourceFileLoader("use_lldb_suite_root", path
)
26 spec
= importlib
.util
.spec_from_loader("use_lldb_suite_root", loader
=loader
)
27 module
= importlib
.util
.module_from_spec(spec
)
28 loader
.exec_module(module
)