]> granicus.if.org Git - python/commitdiff
Remove non-existent paths.
authorBrett Cannon <bcannon@gmail.com>
Sat, 20 Mar 2004 21:31:33 +0000 (21:31 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 20 Mar 2004 21:31:33 +0000 (21:31 +0000)
Lib/site.py
Misc/NEWS

index 682bbd5e407efac3f759fbd59e67076693ccdd9d..148a93f0b36b9a77aba7626c24970177ed58380e 100644 (file)
@@ -79,7 +79,7 @@ for dir in sys.path:
     # if they only differ in case); turn relative paths into absolute
     # paths.
     dir, dircase = makepath(dir)
-    if not dircase in _dirs_in_sys_path:
+    if not dircase in _dirs_in_sys_path and os.path.exists(dir):
         L.append(dir)
         _dirs_in_sys_path[dircase] = 1
 sys.path[:] = L
index a1a53511a98ba3678628445189e87068ff405e10..b0693e04445f84a7479471a24a9f3e06ef40f24a 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -276,6 +276,8 @@ Extension modules
 Library
 -------
 
+- site.py now removes paths that do not exist.
+
 - The ptcp154 codec was added for Kazakh character set support.
 
 - Support non-anonymous ftp URLs in urllib2.