eric6.py: make sure our executable directory (i.e. that of the used Python interpreter) is included in the executable search path.

Mon, 04 May 2020 17:20:19 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 04 May 2020 17:20:19 +0200
changeset 7574
3fbc430c4091
parent 7573
07f0430ca578
child 7575
3ebd1db41c15

eric6.py: make sure our executable directory (i.e. that of the used Python interpreter) is included in the executable search path.

eric6/eric6.py file | annotate | diff | comparison | revisions
--- a/eric6/eric6.py	Sun May 03 17:18:18 2020 +0200
+++ b/eric6/eric6.py	Mon May 04 17:20:19 2020 +0200
@@ -293,6 +293,14 @@
     if "__PYVENV_LAUNCHER__" in os.environ:
         del os.environ["__PYVENV_LAUNCHER__"]
     
+    # make sure our executable directory (i.e. that of the used Python
+    # interpreter) is included in the executable search path
+    pathList = os.environ["PATH"].split(os.pathsep)
+    exeDir = os.path.dirname(sys.executable)
+    if exeDir not in pathList:
+        pathList.insert(0, exeDir)
+    os.environ["PATH"] = os.pathsep.join(pathList)
+    
     from Toolbox import Startup
     # set the library paths for plugins
     Startup.setLibraryPaths()

eric ide

mercurial