diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-13 22:25:01 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-13 22:25:01 (GMT) |
commit | e9b428f9977f8733e6b0d2c321c093779f95080f (patch) | |
tree | 2583b8f93efed20d9d849cbd1b001e4282e32f00 /Lib/site.py | |
parent | 09c449c7de0fea077ceaee5cb04017d6994341e7 (diff) | |
download | cpython-e9b428f9977f8733e6b0d2c321c093779f95080f.zip cpython-e9b428f9977f8733e6b0d2c321c093779f95080f.tar.gz cpython-e9b428f9977f8733e6b0d2c321c093779f95080f.tar.bz2 |
Reimplement addbuilddir() in C inside getpath.c, so as to execute it
at interpreter startup before importing any non-builtin modules.
Should fix #9589.
Diffstat (limited to 'Lib/site.py')
-rw-r--r-- | Lib/site.py | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/Lib/site.py b/Lib/site.py index 2944934..f108432 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -107,18 +107,6 @@ def removeduppaths(): sys.path[:] = L return known_paths -# XXX This should not be part of site.py, since it is needed even when -# using the -S option for Python. See http://www.python.org/sf/586680 -def addbuilddir(): - """Append ./build/lib.<platform> in case we're running in the build dir - (especially for Guido :-)""" - from sysconfig import get_platform - s = "build/lib.%s-%.3s" % (get_platform(), sys.version) - if hasattr(sys, 'gettotalrefcount'): - s += '-pydebug' - s = os.path.join(os.path.dirname(sys.path.pop()), s) - sys.path.append(s) - def _init_pathinfo(): """Return a set containing all existing directory entries from sys.path""" @@ -529,9 +517,6 @@ def main(): abs_paths() known_paths = removeduppaths() - if (os.name == "posix" and sys.path and - os.path.basename(sys.path[-1]) == "Modules"): - addbuilddir() if ENABLE_USER_SITE is None: ENABLE_USER_SITE = check_enableusersite() known_paths = addusersitepackages(known_paths) |