commit de7bc247b3708e639e11384268853fa8b5579387
Author: Utkarsh Ayachit <utkarsh.ayachit@kitware.com>
Date:   Thu Jun 27 10:54:01 2013 -0400

    BUG #14148. Fix location of executable path.
    
    When executable was run from PATH, we were not determining the executable path
    correctly which was messing up the logic to find Python module paths. This fixes
    that issue.
    
    Change-Id: I1db76f3f5ca9b4e9b9de26f02584332689ef7632

diff --git a/ParaViewCore/ClientServerCore/Core/vtkProcessModule.cxx b/ParaViewCore/ClientServerCore/Core/vtkProcessModule.cxx
index 2e2e27f..45a653b0 100644
--- a/ParaViewCore/ClientServerCore/Core/vtkProcessModule.cxx
+++ b/ParaViewCore/ClientServerCore/Core/vtkProcessModule.cxx
@@ -457,7 +457,13 @@ bool vtkProcessModule::InitializePythonEnvironment(int argc, char** argv)
 
   if (argc > 0)
     {
-    programname = vtksys::SystemTools::CollapseFullPath(argv[0]);
+    std::string errMsg;
+    if (!vtksys::SystemTools::FindProgramPath(argv[0], programname, errMsg))
+      {
+      // if FindProgramPath fails. We really don't have much of an alternative
+      // here. Python module importing is going to fail.
+      programname = vtksys::SystemTools::CollapseFullPath(argv[0]);
+      }
     self_dir = vtksys::SystemTools::GetFilenamePath(programname.c_str());
     }
   else
