Issue #8205: Remove the "Modules" directory from sys.path when Python is running from the build directory (POSIX only).
diff --git a/Lib/site.py b/Lib/site.py
index e391670..b36df1f 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -118,7 +118,7 @@
     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)