[pypy-commit] pypy stdlib-unification: adapt sandbox interaction test to unified site
RonnyPfannschmidt
noreply at buildbot.pypy.org
Thu Apr 12 15:24:48 CEST 2012
Author: Ronny Pfannschmidt <Ronny.Pfannschmidt at gmx.de>
Branch: stdlib-unification
Changeset: r54309:08c38e4707f6
Date: 2012-04-12 15:24 +0200
http://bitbucket.org/pypy/pypy/changeset/08c38e4707f6/
Log: adapt sandbox interaction test to unified site
diff --git a/pypy/module/sys/state.py b/pypy/module/sys/state.py
--- a/pypy/module/sys/state.py
+++ b/pypy/module/sys/state.py
@@ -42,8 +42,6 @@
lib_python = os.path.join(prefix, 'lib-python')
python_std_lib = os.path.join(lib_python, dirname)
checkdir(python_std_lib)
- python_std_lib_modified = os.path.join(lib_python, 'modified-' + dirname)
- checkdir(python_std_lib_modified)
lib_pypy = os.path.join(prefix, 'lib_pypy')
checkdir(lib_pypy)
@@ -56,12 +54,9 @@
importlist.append(lib_extensions)
#
importlist.append(lib_pypy)
- importlist.append(python_std_lib_modified)
importlist.append(python_std_lib)
#
- lib_tk_modified = os.path.join(python_std_lib_modified, 'lib-tk')
lib_tk = os.path.join(python_std_lib, 'lib-tk')
- importlist.append(lib_tk_modified)
importlist.append(lib_tk)
#
# List here the extra platform-specific paths.
diff --git a/pypy/tool/lib_pypy.py b/pypy/tool/lib_pypy.py
--- a/pypy/tool/lib_pypy.py
+++ b/pypy/tool/lib_pypy.py
@@ -5,9 +5,7 @@
LIB_ROOT = py.path.local(pypy.__path__[0]).dirpath()
LIB_PYPY = LIB_ROOT.join('lib_pypy')
-LIB_PYTHON = LIB_ROOT.join('lib-python')
-LIB_PYTHON_VANILLA = LIB_PYTHON.join('%d.%d' % CPYTHON_VERSION[:2])
-LIB_PYTHON_MODIFIED = LIB_PYTHON.join('modified-%d.%d' % CPYTHON_VERSION[:2])
+LIB_PYTHON = LIB_ROOT.join('lib-python', '%d.%d' % CPYTHON_VERSION[:2])
def import_from_lib_pypy(modname):
diff --git a/pypy/tool/stdlib_opcode.py b/pypy/tool/stdlib_opcode.py
--- a/pypy/tool/stdlib_opcode.py
+++ b/pypy/tool/stdlib_opcode.py
@@ -106,8 +106,8 @@
opmap as host_opmap, HAVE_ARGUMENT as host_HAVE_ARGUMENT)
def load_pypy_opcode():
- from pypy.tool.lib_pypy import LIB_PYTHON_MODIFIED
- opcode_path = LIB_PYTHON_MODIFIED.join('opcode.py')
+ from pypy.tool.lib_pypy import LIB_PYTHON
+ opcode_path = LIB_PYTHON.join('opcode.py')
d = {}
execfile(str(opcode_path), d)
for name in __all__:
diff --git a/pypy/translator/sandbox/test/test_pypy_interact.py b/pypy/translator/sandbox/test/test_pypy_interact.py
--- a/pypy/translator/sandbox/test/test_pypy_interact.py
+++ b/pypy/translator/sandbox/test/test_pypy_interact.py
@@ -2,14 +2,12 @@
import os, sys, stat, errno
from pypy.translator.sandbox.pypy_interact import PyPySandboxedProc
from pypy.translator.interactive import Translation
+
from pypy.module.sys.version import CPYTHON_VERSION
+from pypy.tool.lib_pypy import LIB_PYTHON
VERSION = '%d.%d' % CPYTHON_VERSION[:2]
-SITE_PY_CONTENT = open(os.path.join(autopath.pypydir,
- '..',
- 'lib-python',
- 'modified-' + VERSION, 'site.py'),
- 'rb').read()
+SITE_PY_CONTENT = LIB_PYTHON.join('site.py').read()
ERROR_TEXT = os.strerror(errno.ENOENT)
def assert_(cond, text):
@@ -39,15 +37,14 @@
pass
else:
assert_(False, "os.stat('site') should have failed")
- st = os.stat('/bin/lib-python/modified-%s/site.py' % VERSION)
- assert_(stat.S_ISREG(st.st_mode), "bad st_mode for .../site.py")
+
try:
- os.stat('/bin/lib-python/modified-%s/site.pyc' % VERSION)
+ os.stat('/bin/lib-python/%s/site.pyc' % VERSION)
except OSError:
pass
else:
assert_(False, "os.stat('....pyc') should have failed")
- fd = os.open('/bin/lib-python/modified-%s/site.py' % VERSION,
+ fd = os.open('/bin/lib-python/%s/site.py' % VERSION,
os.O_RDONLY, 0666)
length = 8192
ofs = 0
More information about the pypy-commit
mailing list