Adding support for loading the scripting resource as part of a framework, lacking the dSYM bundle, or if the bundle has no Pythonic resources whatsoever

Solving an issue where "command script import" would fail to pick the file indicated by the user as a result of something with the same name being in an earlier position in sys.path

llvm-svn: 167570
This commit is contained in:
Enrico Granata
2012-11-08 02:44:10 +00:00
parent 1759848be0
commit 2ffcf43a13
2 changed files with 24 additions and 3 deletions

View File

@@ -2424,7 +2424,7 @@ ScriptInterpreterPython::LoadScriptingModule (const char* pathname,
// now make sure that Python has "directory" in the search path
StreamString command_stream;
command_stream.Printf("if not (sys.path.__contains__('%s')):\n sys.path.append('%s');\n\n",
command_stream.Printf("if not (sys.path.__contains__('%s')):\n sys.path.insert(1,'%s');\n\n",
directory,
directory);
bool syspath_retval = ExecuteMultipleLines(command_stream.GetData(), ScriptInterpreter::ExecuteScriptOptions().SetEnableIO(false).SetSetLLDBGlobals(false));