[pypy-svn] r79354 - in pypy/release/1.4.x: lib-python/modified-2.5.2 pypy/module/sys pypy/module/sys/test
arigo at codespeak.net
arigo at codespeak.net
Mon Nov 22 18:12:54 CET 2010
Author: arigo
Date: Mon Nov 22 18:12:52 2010
New Revision: 79354
Modified:
pypy/release/1.4.x/lib-python/modified-2.5.2/site.py
pypy/release/1.4.x/pypy/module/sys/state.py
pypy/release/1.4.x/pypy/module/sys/test/test_initialpath.py
Log:
Revert the temporary fix in r79320, and add the proper fixes
from trunk (r79319, r79332, r79337).
Modified: pypy/release/1.4.x/lib-python/modified-2.5.2/site.py
==============================================================================
--- pypy/release/1.4.x/lib-python/modified-2.5.2/site.py (original)
+++ pypy/release/1.4.x/lib-python/modified-2.5.2/site.py Mon Nov 22 18:12:52 2010
@@ -380,10 +380,6 @@
def main():
abs__file__()
- # TMP
- if sys.platform == "darwin":
- sys.path.append(sys.path[-1] + "/plat-mac")
- # /TMP
paths_in_sys = removeduppaths()
if (os.name == "posix" and sys.path and
os.path.basename(sys.path[-1]) == "Modules"):
Modified: pypy/release/1.4.x/pypy/module/sys/state.py
==============================================================================
--- pypy/release/1.4.x/pypy/module/sys/state.py (original)
+++ pypy/release/1.4.x/pypy/module/sys/state.py Mon Nov 22 18:12:52 2010
@@ -33,6 +33,8 @@
raise OSError(errno.ENOTDIR, path)
+platform = sys.platform
+
def getinitialpath(prefix):
from pypy.module.sys.version import CPYTHON_VERSION
dirname = '%d.%d.%d' % (CPYTHON_VERSION[0],
@@ -51,6 +53,15 @@
importlist.append(lib_pypy)
importlist.append(python_std_lib_modified)
importlist.append(python_std_lib)
+ #
+ # List here the extra platform-specific paths.
+ if platform != 'win32':
+ importlist.append(os.path.join(python_std_lib, 'plat-'+platform))
+ if platform == 'darwin':
+ platmac = os.path.join(python_std_lib, 'plat-mac')
+ importlist.append(platmac)
+ importlist.append(os.path.join(platmac, 'lib-scriptpackages'))
+ #
return importlist
def pypy_initial_path(space, srcdir):
Modified: pypy/release/1.4.x/pypy/module/sys/test/test_initialpath.py
==============================================================================
--- pypy/release/1.4.x/pypy/module/sys/test/test_initialpath.py (original)
+++ pypy/release/1.4.x/pypy/module/sys/test/test_initialpath.py Mon Nov 22 18:12:52 2010
@@ -15,4 +15,5 @@
def test_stdlib_in_prefix(tmpdir):
dirs = build_hierarchy(tmpdir)
path = getinitialpath(str(tmpdir))
- assert path == map(str, dirs)
+ # we get at least 'dirs', and maybe more (e.g. plat-linux2)
+ assert path[:len(dirs)] == map(str, dirs)
More information about the Pypy-commit
mailing list