[Checkins] SVN: zc.buildout/trunk/ Remove duplicate path from script's sys.path setup.

Hanno Schlichting hannosch at hannosch.eu
Sat Mar 12 02:46:07 EST 2011


Log message for revision 120882:
  Remove duplicate path from script's sys.path setup.
  

Changed:
  U   zc.buildout/trunk/CHANGES.txt
  U   zc.buildout/trunk/src/zc/buildout/easy_install.py

-=-
Modified: zc.buildout/trunk/CHANGES.txt
===================================================================
--- zc.buildout/trunk/CHANGES.txt	2011-03-12 00:46:51 UTC (rev 120881)
+++ zc.buildout/trunk/CHANGES.txt	2011-03-12 07:46:06 UTC (rev 120882)
@@ -4,6 +4,8 @@
 1.5.3 (unreleased)
 ==================
 
+- Remove duplicate path from script's sys.path setup.
+
 - changed broken dash S check to pass the configuration options
   -S -c separately, to make zc.buildout more compatible with the PyPy
   interpreter, which has less flexible argument parsing than CPython.

Modified: zc.buildout/trunk/src/zc/buildout/easy_install.py
===================================================================
--- zc.buildout/trunk/src/zc/buildout/easy_install.py	2011-03-12 00:46:51 UTC (rev 120881)
+++ zc.buildout/trunk/src/zc/buildout/easy_install.py	2011-03-12 07:46:06 UTC (rev 120882)
@@ -1301,7 +1301,12 @@
     """Given working set and extra paths, return a normalized path list."""
     path = [dist.location for dist in working_set]
     path.extend(extra_paths)
-    return map(realpath, path)
+    # order preserving unique
+    unique_path = []
+    for p in path:
+        if p not in unique_path:
+            unique_path.append(p)
+    return map(realpath, unique_path)
 
 def _generate_scripts(reqs, working_set, dest, path, scripts, relative_paths,
                       initialization, executable, arguments,



More information about the checkins mailing list