c6247fd
Index: Misc/NEWS
c6247fd
===================================================================
c6247fd
--- Misc/NEWS	(revision 79309)
c6247fd
+++ Misc/NEWS	(revision 79310)
c6247fd
@@ -29,6 +29,9 @@
c6247fd
 Library
c6247fd
 -------
c6247fd
 
c6247fd
+- Issue #8205: Remove the "Modules" directory from sys.path when Python is
c6247fd
+  running from the build directory (POSIX only).
c6247fd
+
c6247fd
 - Issue #7667: Fix doctest failures with non-ASCII paths.
c6247fd
 
c6247fd
 - Issue #7512: shutil.copystat() could raise an OSError when the filesystem
c6247fd
Index: Lib/site.py
c6247fd
===================================================================
c6247fd
--- Lib/site.py	(revision 79309)
c6247fd
+++ Lib/site.py	(revision 79310)
c6247fd
@@ -118,7 +118,7 @@
c6247fd
     s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
c6247fd
     if hasattr(sys, 'gettotalrefcount'):
c6247fd
         s += '-pydebug'
c6247fd
-    s = os.path.join(os.path.dirname(sys.path[-1]), s)
c6247fd
+    s = os.path.join(os.path.dirname(sys.path.pop()), s)
c6247fd
     sys.path.append(s)
c6247fd
 
c6247fd