diff --git a/lldb/scripts/use_lldb_suite.py b/lldb/scripts/use_lldb_suite.py index 6e24b9da8d34..a1a2e8b93679 100644 --- a/lldb/scripts/use_lldb_suite.py +++ b/lldb/scripts/use_lldb_suite.py @@ -6,9 +6,10 @@ import sys def find_lldb_root(): lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe())) while True: - lldb_root = os.path.dirname(lldb_root) - if lldb_root is None: - return None + parent = os.path.dirname(lldb_root) + if parent == lldb_root: # dirname('/') == '/' + break + lldb_root = parent test_path = os.path.join(lldb_root, "use_lldb_suite_root.py") if os.path.isfile(test_path):