[pypy-svn] pypy default: (fijal, arigo)

arigo commits-noreply at bitbucket.org
Thu Jan 20 14:08:59 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41016:950f091d42f8
Date: 2011-01-20 14:08 +0100
http://bitbucket.org/pypy/pypy/changeset/950f091d42f8/

Log:	(fijal, arigo)

	Update the test to lib-python/modified-X.Y.Z (instead of 2.5.2).

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,8 +2,13 @@
 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
 
-SITE_PY_CONTENT = open(os.path.join(autopath.libpythonmodifieddir, 'site.py'),
+VERSION = '%d.%d.%d' % CPYTHON_VERSION[:3]
+SITE_PY_CONTENT = open(os.path.join(autopath.pypydir,
+                                    '..',
+                                    'lib-python',
+                                    'modified-' + VERSION, 'site.py'),
                        'rb').read()
 ERROR_TEXT = os.strerror(errno.ENOENT)
 
@@ -24,7 +29,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/lib_pypy']:
+    for dirname in ['/bin/lib-python/' + VERSION, '/bin/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 +39,16 @@
         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-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-2.5.2/site.pyc')
+        os.stat('/bin/lib-python/modified-%s/site.pyc' % VERSION)
     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-python/modified-%s/site.py' % VERSION,
+                 os.O_RDONLY, 0666)
     length = 8192
     ofs = 0
     while True:


More information about the Pypy-commit mailing list