[pypy-svn] r75268 - in pypy/branch/sys-prefix/pypy: tool translator/sandbox translator/sandbox/test
antocuni at codespeak.net
antocuni at codespeak.net
Fri Jun 11 15:10:14 CEST 2010
Author: antocuni
Date: Fri Jun 11 15:10:13 2010
New Revision: 75268
Modified:
pypy/branch/sys-prefix/pypy/tool/lib_pypy.py
pypy/branch/sys-prefix/pypy/translator/sandbox/pypy_interact.py
pypy/branch/sys-prefix/pypy/translator/sandbox/test/test_pypy_interact.py
Log:
fix pypy_interact to follow the new directory layout
Modified: pypy/branch/sys-prefix/pypy/tool/lib_pypy.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/tool/lib_pypy.py (original)
+++ pypy/branch/sys-prefix/pypy/tool/lib_pypy.py Fri Jun 11 15:10:13 2010
@@ -6,8 +6,9 @@
prefix = py.path.local(pypy.__path__[0]).dirpath()
pypy_ver = 'pypy%d.%d' % PYPY_VERSION[:2]
-LIB_PYPY = prefix.join('lib', pypy_ver, 'lib_pypy')
-LIB_PYTHON = prefix.join('lib', pypy_ver, 'lib-python')
+LIB_ROOT = prefix.join('lib', pypy_ver)
+LIB_PYPY = LIB_ROOT.join('lib_pypy')
+LIB_PYTHON = LIB_ROOT.join('lib-python')
LIB_PYTHON_VANILLA = LIB_PYTHON.join('%d.%d.%d' % CPYTHON_VERSION[:3])
LIB_PYTHON_MODIFIED = LIB_PYTHON.join('modified-%d.%d.%d' % CPYTHON_VERSION[:3])
Modified: pypy/branch/sys-prefix/pypy/translator/sandbox/pypy_interact.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/sandbox/pypy_interact.py (original)
+++ pypy/branch/sys-prefix/pypy/translator/sandbox/pypy_interact.py Fri Jun 11 15:10:13 2010
@@ -26,6 +26,7 @@
from pypy.translator.sandbox.sandlib import SimpleIOSandboxedProc
from pypy.translator.sandbox.sandlib import VirtualizedSandboxedProc
from pypy.translator.sandbox.vfs import Dir, RealDir, RealFile
+from pypy.tool.lib_pypy import LIB_ROOT
class PyPySandboxedProc(VirtualizedSandboxedProc, SimpleIOSandboxedProc):
debug = True
@@ -50,21 +51,15 @@
tmpdirnode = Dir({})
else:
tmpdirnode = RealDir(self.tmpdir, exclude=exclude)
- pypydist = os.path.dirname(os.path.abspath(autopath.pypydir))
+ libpath = str(LIB_ROOT.dirpath())
return Dir({
'bin': Dir({
'pypy-c': RealFile(self.executable),
- 'lib-python': RealDir(os.path.join(pypydist, 'lib-python'),
- exclude=exclude),
- # XXX: fix this (and write a test!)
- 'pypy': Dir({
- 'lib': RealDir(os.path.join(pypydist, 'pypy', 'lib'),
- exclude=exclude),
+ 'lib': RealDir(libpath, exclude=exclude),
}),
- }),
- 'tmp': tmpdirnode,
- })
+ 'tmp': tmpdirnode,
+ })
if __name__ == '__main__':
Modified: pypy/branch/sys-prefix/pypy/translator/sandbox/test/test_pypy_interact.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/sandbox/test/test_pypy_interact.py (original)
+++ pypy/branch/sys-prefix/pypy/translator/sandbox/test/test_pypy_interact.py Fri Jun 11 15:10:13 2010
@@ -24,7 +24,7 @@
assert_(argv[0] == '/bin/pypy-c', "bad argv[0]")
st = os.lstat('/bin/pypy-c')
assert_(stat.S_ISREG(st.st_mode), "bad st_mode for /bin/pypy-c")
- for dirname in ['/bin/lib-python/2.5.2', '/bin/pypy/lib']:
+ for dirname in ['/bin/lib/pypy1.2/lib-python/2.5.2', '/bin/lib/pypy1.2/lib_pypy']:
st = os.stat(dirname)
assert_(stat.S_ISDIR(st.st_mode), "bad st_mode for " + dirname)
assert_(os.environ.get('PYTHONPATH') is None, "unexpected $PYTHONPATH")
@@ -34,15 +34,15 @@
pass
else:
assert_(False, "os.stat('site') should have failed")
- st = os.stat('/bin/lib-python/modified-2.5.2/site.py')
+ st = os.stat('/bin/lib/pypy1.2/lib-python/modified-2.5.2/site.py')
assert_(stat.S_ISREG(st.st_mode), "bad st_mode for .../site.py")
try:
- os.stat('/bin/lib-python/modified-2.5.2/site.pyc')
+ os.stat('/bin/lib/pypy1.2/lib-python/modified-2.5.2/site.pyc')
except OSError:
pass
else:
assert_(False, "os.stat('....pyc') should have failed")
- fd = os.open('/bin/lib-python/modified-2.5.2/site.py', os.O_RDONLY, 0666)
+ fd = os.open('/bin/lib/pypy1.2/lib-python/modified-2.5.2/site.py', os.O_RDONLY, 0666)
length = 8192
ofs = 0
while True:
More information about the Pypy-commit
mailing list