diff --git a/Lib/site.py b/Lib/site.py index 3f4e8304c00..12fe71d4599 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -79,6 +79,15 @@ def makepath(*paths): sys.path[:] = L del dir, L +# Append ./build/lib. in case we're running in the build dir +# (especially for Guido :-) +if os.name == "posix" and os.path.basename(sys.path[-1]) == "Modules": + from distutils.util import get_platform + s = "build/lib.%s-%.3s" % (get_platform(), sys.version) + s = os.path.join(os.path.dirname(sys.path[-1]), s) + sys.path.append(s) + del get_platform, s + def addsitedir(sitedir): sitedir = makepath(sitedir) if sitedir not in sys.path: