]> granicus.if.org Git - python/commitdiff
Issue #8205: Remove the "Modules" directory from sys.path when Python is running...
authorFlorent Xicluna <florent.xicluna@gmail.com>
Mon, 22 Mar 2010 22:52:11 +0000 (22:52 +0000)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Mon, 22 Mar 2010 22:52:11 +0000 (22:52 +0000)
Lib/site.py
Misc/NEWS

index e391670ed401f43b90fbdf871003cf664d45ed71..b36df1f5dce4a876b9370f0c5ca37f72058dc89b 100644 (file)
@@ -118,7 +118,7 @@ def addbuilddir():
     s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
     if hasattr(sys, 'gettotalrefcount'):
         s += '-pydebug'
-    s = os.path.join(os.path.dirname(sys.path[-1]), s)
+    s = os.path.join(os.path.dirname(sys.path.pop()), s)
     sys.path.append(s)
 
 
index f05e90ef1e42ab217acb597792745ffa9ebd1bec..7395196495ceb23733eca381a41dd130ec6fb9c4 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -29,6 +29,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #8205: Remove the "Modules" directory from sys.path when Python is
+  running from the build directory (POSIX only).
+
 - Issue #7667: Fix doctest failures with non-ASCII paths.
 
 - Issue #7512: shutil.copystat() could raise an OSError when the filesystem