install.py

changeset 4911
652cb0520e9a
parent 4889
10cec9d5aa91
child 4915
8081031061a2
--- a/install.py	Mon Mar 28 13:32:00 2016 +0200
+++ b/install.py	Sun Apr 03 12:29:37 2016 +0200
@@ -900,10 +900,13 @@
     if path:
         pybin = os.path.join(sys.exec_prefix, "bin")
         pathlist = path.split(os.pathsep)
-        if pybin not in pathlist:
-            pathLine = "PATH={0}{1}{2}\n".format(pybin, os.pathsep, path)
-        else:
-            pathLine = "PATH={0}\n".format(path)
+        pathlist_n = [pybin]
+        for path_ in pathlist:
+            if path_ and path_ not in pathlist_n:
+                pathlist_n.append(path_)
+        pathLine = "PATH={0}\n".format(os.pathsep.join(pathlist_n))
+    
+    # create the wrapper script
     wrapper = ('''#!/bin/sh\n'''
                '''\n'''
                '''{0}'''

eric ide

mercurial