diff options
| author | Enrico Granata <egranata@apple.com> | 2013-05-08 21:26:37 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2013-05-08 21:26:37 +0000 |
| commit | b7d6e2a4e0e62d5022c8a6a77d34911e2dbede6d (patch) | |
| tree | 6ee6fd3f5b4fa7ea9ec7ec9a876cda9cc68d837a /lldb/source/Interpreter/ScriptInterpreterPython.cpp | |
| parent | 697fa1c8be6c52a5f1c72b35bb9fe3004e3e40e2 (diff) | |
Test case added for importing packages
llvm-svn: 181472
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
| -rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 5a4fa625a0af..5b6e0f5d80e8 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -2602,13 +2602,8 @@ ScriptInterpreterPython::LoadScriptingModule (const char* pathname, Locker::AcquireLock | (init_session ? Locker::InitSession : 0), Locker::FreeAcquiredLock | (init_session ? Locker::TearDownSession : 0)); - if (target_file.GetFileType() == FileSpec::eFileTypeDirectory) - { - // for directories, just import - basename = pathname; - } - else if (target_file.GetFileType() == FileSpec::eFileTypeInvalid || - target_file.GetFileType() == FileSpec::eFileTypeUnknown) + if (target_file.GetFileType() == FileSpec::eFileTypeInvalid || + target_file.GetFileType() == FileSpec::eFileTypeUnknown) { // if not a valid file of any sort, check if it might be a filename still // dot can't be used but / and \ can, and if either is found, reject @@ -2619,7 +2614,9 @@ ScriptInterpreterPython::LoadScriptingModule (const char* pathname, } basename = pathname; // not a filename, probably a package of some sort, let it go through } - else + else if (target_file.GetFileType() == FileSpec::eFileTypeDirectory || + target_file.GetFileType() == FileSpec::eFileTypeRegular || + target_file.GetFileType() == FileSpec::eFileTypeSymbolicLink) { const char* directory = target_file.GetDirectory().GetCString(); @@ -2645,6 +2642,11 @@ ScriptInterpreterPython::LoadScriptingModule (const char* pathname, basename.resize(basename.length()-4); } } + else + { + error.SetErrorString("no known way to import this module specification"); + return false; + } // check if the module is already import-ed command_stream.Clear(); |
