From ff33eefcc7d35bf11330240416a26804c6ff0d2e Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 13 May 2015 19:44:57 +0000 Subject: Fix an issue with finding python on Windows. Someone must have changed the behavior of FileSpec slightly relating to whether or not there is a trailing backslash when calling GetPath() and GetDirectory(). This caused ScriptInterpreterPython to find the wrong values when initializing sys.path, and as a result we couldn't find the lldb module. This patch fixes the issue, and also adds a test to make sure that GetDirectory() does not return a string containing a trailing slash. llvm-svn: 237282 --- lldb/source/Host/windows/HostInfoWindows.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lldb/source/Host/windows/HostInfoWindows.cpp') diff --git a/lldb/source/Host/windows/HostInfoWindows.cpp b/lldb/source/Host/windows/HostInfoWindows.cpp index b1c880f0ffe..6dce71d9172 100644 --- a/lldb/source/Host/windows/HostInfoWindows.cpp +++ b/lldb/source/Host/windows/HostInfoWindows.cpp @@ -109,8 +109,7 @@ HostInfoWindows::ComputePythonDirectory(FileSpec &file_spec) FileSpec lldb_file_spec; if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec)) return false; - llvm::SmallString<64> path; - lldb_file_spec.GetPath(path); + llvm::SmallString<64> path(lldb_file_spec.GetDirectory().AsCString()); llvm::sys::path::remove_filename(path); llvm::sys::path::append(path, "lib", "site-packages"); std::replace(path.begin(), path.end(), '\\', '/'); -- cgit v1.2.3