[pypy-svn] r75264 - in pypy/branch/sys-prefix: lib-python lib/pypy1.2/lib-python pypy pypy/annotation/test pypy/bin pypy/config pypy/doc/config pypy/interpreter pypy/jit/backend pypy/jit/backend/x86 pypy/jit/backend/x86/tool pypy/jit/tl pypy/jit/tl/spli pypy/jit/tool pypy/module/__builtin__/test pypy/module/_codecs/test pypy/module/_sre/test pypy/module/sys pypy/module/sys/test pypy/module/test_lib_pypy pypy/rlib/parsing/test pypy/rlib/rsdl/test pypy/rpython/microbench pypy/tool pypy/tool/algo/test pypy/tool/pytest pypy/tool/test pypy/translator pypy/translator/benchmark pypy/translator/c pypy/translator/c/gcc pypy/translator/c/test pypy/translator/cli/test pypy/translator/goal pypy/translator/goal/test2 pypy/translator/microbench/pybench pypy/translator/sandbox pypy/translator/sandbox/test pypy/translator/test pypy/translator/tool

antocuni at codespeak.net antocuni at codespeak.net
Fri Jun 11 13:27:47 CEST 2010


Author: antocuni
Date: Fri Jun 11 13:27:44 2010
New Revision: 75264

Added:
   pypy/branch/sys-prefix/lib/pypy1.2/lib-python/
      - copied from r75257, pypy/branch/sys-prefix/lib-python/
Removed:
   pypy/branch/sys-prefix/lib-python/
Modified:
   pypy/branch/sys-prefix/pypy/annotation/test/autopath.py
   pypy/branch/sys-prefix/pypy/bin/autopath.py
   pypy/branch/sys-prefix/pypy/config/autopath.py
   pypy/branch/sys-prefix/pypy/conftest.py
   pypy/branch/sys-prefix/pypy/doc/config/autopath.py
   pypy/branch/sys-prefix/pypy/interpreter/baseobjspace.py
   pypy/branch/sys-prefix/pypy/jit/backend/autopath.py
   pypy/branch/sys-prefix/pypy/jit/backend/x86/autopath.py
   pypy/branch/sys-prefix/pypy/jit/backend/x86/tool/autopath.py
   pypy/branch/sys-prefix/pypy/jit/tl/autopath.py
   pypy/branch/sys-prefix/pypy/jit/tl/spli/autopath.py
   pypy/branch/sys-prefix/pypy/jit/tool/autopath.py
   pypy/branch/sys-prefix/pypy/module/__builtin__/test/autopath.py
   pypy/branch/sys-prefix/pypy/module/_codecs/test/autopath.py
   pypy/branch/sys-prefix/pypy/module/_sre/test/autopath.py
   pypy/branch/sys-prefix/pypy/module/sys/state.py
   pypy/branch/sys-prefix/pypy/module/sys/test/autopath.py
   pypy/branch/sys-prefix/pypy/module/test_lib_pypy/test_array.py
   pypy/branch/sys-prefix/pypy/rlib/parsing/test/autopath.py
   pypy/branch/sys-prefix/pypy/rlib/rsdl/test/autopath.py
   pypy/branch/sys-prefix/pypy/rpython/microbench/autopath.py
   pypy/branch/sys-prefix/pypy/tool/algo/test/autopath.py
   pypy/branch/sys-prefix/pypy/tool/autopath.py
   pypy/branch/sys-prefix/pypy/tool/lib_pypy.py
   pypy/branch/sys-prefix/pypy/tool/pytest/autopath.py
   pypy/branch/sys-prefix/pypy/tool/pytest/confpath.py
   pypy/branch/sys-prefix/pypy/tool/stdlib___future__.py
   pypy/branch/sys-prefix/pypy/tool/stdlib_opcode.py
   pypy/branch/sys-prefix/pypy/tool/test/autopath.py
   pypy/branch/sys-prefix/pypy/tool/test/test_lib_pypy.py
   pypy/branch/sys-prefix/pypy/translator/autopath.py
   pypy/branch/sys-prefix/pypy/translator/benchmark/autopath.py
   pypy/branch/sys-prefix/pypy/translator/c/autopath.py
   pypy/branch/sys-prefix/pypy/translator/c/gcc/autopath.py
   pypy/branch/sys-prefix/pypy/translator/c/test/autopath.py
   pypy/branch/sys-prefix/pypy/translator/cli/test/autopath.py
   pypy/branch/sys-prefix/pypy/translator/geninterplevel.py
   pypy/branch/sys-prefix/pypy/translator/goal/autopath.py
   pypy/branch/sys-prefix/pypy/translator/goal/test2/autopath.py
   pypy/branch/sys-prefix/pypy/translator/goal/test2/test_app_main.py
   pypy/branch/sys-prefix/pypy/translator/microbench/pybench/autopath.py
   pypy/branch/sys-prefix/pypy/translator/sandbox/autopath.py
   pypy/branch/sys-prefix/pypy/translator/sandbox/test/autopath.py
   pypy/branch/sys-prefix/pypy/translator/test/autopath.py
   pypy/branch/sys-prefix/pypy/translator/tool/autopath.py
Log:
move lib-python to lib/pypy1.2



Modified: pypy/branch/sys-prefix/pypy/annotation/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/annotation/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/annotation/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/bin/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/bin/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/bin/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/config/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/config/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/config/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/conftest.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/conftest.py	(original)
+++ pypy/branch/sys-prefix/pypy/conftest.py	Fri Jun 11 13:27:44 2010
@@ -10,7 +10,7 @@
 
 # pytest settings
 pytest_plugins = "resultlog",
-rsyncdirs = ['.', '../lib-python', '../demo']
+rsyncdirs = ['.', '../lib', '../demo']
 rsyncignore = ['_cache']
 
 collect_ignore = ['./lib/py']

Modified: pypy/branch/sys-prefix/pypy/doc/config/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/doc/config/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/doc/config/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/interpreter/baseobjspace.py	(original)
+++ pypy/branch/sys-prefix/pypy/interpreter/baseobjspace.py	Fri Jun 11 13:27:44 2010
@@ -385,7 +385,7 @@
 
     def get_builtinmodule_to_install(self):
         """NOT_RPYTHON"""
-        from pypy.tool.lib_pypy import get_lib_pypy_dir
+        from pypy.tool.lib_pypy import LIB_PYPY
         try:
             return self._builtinmodule_list
         except AttributeError:
@@ -403,10 +403,9 @@
         if ('time2' in modules or 'rctime' in modules) and 'time' in modules:
             modules.remove('time')
 
-        lib_pypy = get_lib_pypy_dir()
         if not self.config.objspace.nofaking:
             for modname in self.ALL_BUILTIN_MODULES:
-                if not lib_pypy.join(modname+'.py').check(file=True):
+                if not LIB_PYPY.join(modname+'.py').check(file=True):
                     modules.append('faked+'+modname)
 
         self._builtinmodule_list = modules

Modified: pypy/branch/sys-prefix/pypy/jit/backend/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/jit/backend/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/jit/backend/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/jit/backend/x86/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/jit/backend/x86/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/jit/backend/x86/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/jit/backend/x86/tool/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/jit/backend/x86/tool/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/jit/backend/x86/tool/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/jit/tl/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/jit/tl/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/jit/tl/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/jit/tl/spli/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/jit/tl/spli/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/jit/tl/spli/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/jit/tool/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/jit/tool/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/jit/tool/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/module/__builtin__/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/module/__builtin__/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/module/__builtin__/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/module/_codecs/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/module/_codecs/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/module/_codecs/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/module/_sre/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/module/_sre/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/module/_sre/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/module/sys/state.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/module/sys/state.py	(original)
+++ pypy/branch/sys-prefix/pypy/module/sys/state.py	Fri Jun 11 13:27:44 2010
@@ -36,19 +36,19 @@
     # build the initial path from the srcdir, which is the path of
     # the "dist" directory of a PyPy checkout.
     from pypy.module.sys.version import CPYTHON_VERSION, PYPY_VERSION
+    libdir = os.path.join(srcdir, 'lib')
+    pypyxy_dir = os.path.join(libdir, 'pypy%d.%d' % PYPY_VERSION[:2])
 
     dirname = '%d.%d.%d' % (CPYTHON_VERSION[0],
                             CPYTHON_VERSION[1],
                             CPYTHON_VERSION[2])
-    lib_python = os.path.join(srcdir, 'lib-python')
+    lib_python = os.path.join(pypyxy_dir, '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)
     
-    libdir = os.path.join(srcdir, 'lib')
-    pypyxy_dir = os.path.join(libdir, 'pypy%d.%d' % PYPY_VERSION[:2])
     lib_pypy = os.path.join(pypyxy_dir, 'lib_pypy')
     checkdir(lib_pypy)
 

Modified: pypy/branch/sys-prefix/pypy/module/sys/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/module/sys/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/module/sys/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/module/test_lib_pypy/test_array.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/module/test_lib_pypy/test_array.py	(original)
+++ pypy/branch/sys-prefix/pypy/module/test_lib_pypy/test_array.py	Fri Jun 11 13:27:44 2010
@@ -73,11 +73,11 @@
 class TestArrayOnTopOfCPython(BaseArrayTests):
 
     def setup_class(cls):
-        from pypy.tool.lib_pypy import get_lib_pypy_dir
+        from pypy.tool.lib_pypy import LIB_PYPY
         if not hasattr(struct, 'pack_into'):
             py.test.skip("requires CPython >= 2.5")
         import new
-        path = get_lib_pypy_dir().join('array.py')
+        path = LIB_PYPY.join('array.py')
         myarraymodule = new.module('array')
         execfile(str(path), myarraymodule.__dict__)
         cls.array = myarraymodule

Modified: pypy/branch/sys-prefix/pypy/rlib/parsing/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/rlib/parsing/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/rlib/parsing/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/rlib/rsdl/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/rlib/rsdl/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/rlib/rsdl/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/rpython/microbench/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/rpython/microbench/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/rpython/microbench/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/tool/algo/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/tool/algo/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/tool/algo/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/tool/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/tool/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/tool/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

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 13:27:44 2010
@@ -1,13 +1,19 @@
 import py
 import pypy
-from pypy.module.sys.version import PYPY_VERSION
+import pypy.module
+from pypy.module.sys.version import PYPY_VERSION, CPYTHON_VERSION
 
-def get_lib_pypy_dir():
-    prefix = py.path.local(pypy.__path__[0]).dirpath()
-    pypy_ver = 'pypy%d.%d' % PYPY_VERSION[:2]
-    return prefix.join('lib', pypy_ver, 'lib_pypy')
+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_PYTHON_VANILLA = LIB_PYTHON.join('%d.%d.%d' % CPYTHON_VERSION[:3])
+LIB_PYTHON_MODIFIED = LIB_PYTHON.join('modified-%d.%d.%d' % CPYTHON_VERSION[:3])
+
+del prefix
+del pypy_ver
 
 def import_from_lib_pypy(modname):
-    dirname = get_lib_pypy_dir()
-    modname = dirname.join(modname+'.py')
+    modname = LIB_PYPY.join(modname+'.py')
     return modname.pyimport()

Modified: pypy/branch/sys-prefix/pypy/tool/pytest/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/tool/pytest/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/tool/pytest/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/tool/pytest/confpath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/tool/pytest/confpath.py	(original)
+++ pypy/branch/sys-prefix/pypy/tool/pytest/confpath.py	Fri Jun 11 13:27:44 2010
@@ -1,11 +1,12 @@
 import autopath 
 import py
 import pypy
+from pypy.tool import lib_pypy
 
 pypydir = py.path.local(pypy.__file__).dirpath()
 distdir = pypydir.dirpath()
 testresultdir = distdir.join('testresult') 
 assert pypydir.check(dir=1) 
-libpythondir = distdir.join('lib-python') 
-regrtestdir = libpythondir.join('2.5.2', 'test') 
-modregrtestdir = libpythondir.join('modified-2.5.2', 'test') 
+libpythondir = lib_pypy.LIB_PYTHON
+regrtestdir = lib_pypy.LIB_PYTHON_VANILLA.join('test') 
+modregrtestdir = lib_pypy.LIB_PYTHON_MODIFIED.join('test') 

Modified: pypy/branch/sys-prefix/pypy/tool/stdlib___future__.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/tool/stdlib___future__.py	(original)
+++ pypy/branch/sys-prefix/pypy/tool/stdlib___future__.py	Fri Jun 11 13:27:44 2010
@@ -1,8 +1,8 @@
 # load __future__.py constants
 
 def load_module():
-    import py
-    module_path = py.path.local(__file__).dirpath().dirpath().dirpath('lib-python/2.5.2/__future__.py')
+    from pypy.tool.lib_pypy import LIB_PYTHON_VANILLA
+    module_path = LIB_PYTHON_VANILLA.join('__future__.py')
     execfile(str(module_path), globals())
 
 load_module()

Modified: pypy/branch/sys-prefix/pypy/tool/stdlib_opcode.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/tool/stdlib_opcode.py	(original)
+++ pypy/branch/sys-prefix/pypy/tool/stdlib_opcode.py	Fri Jun 11 13:27:44 2010
@@ -106,8 +106,8 @@
     opmap as host_opmap, HAVE_ARGUMENT as host_HAVE_ARGUMENT)
 
 def load_pypy_opcode():
-    import py
-    opcode_path = py.path.local(__file__).dirpath().dirpath().dirpath('lib-python/modified-2.5.2/opcode.py')
+    from pypy.tool.lib_pypy import LIB_PYTHON_MODIFIED
+    opcode_path = LIB_PYTHON_MODIFIED.join('opcode.py')
     d = {}
     execfile(str(opcode_path), d)
     for name in __all__:

Modified: pypy/branch/sys-prefix/pypy/tool/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/tool/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/tool/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/tool/test/test_lib_pypy.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/tool/test/test_lib_pypy.py	(original)
+++ pypy/branch/sys-prefix/pypy/tool/test/test_lib_pypy.py	Fri Jun 11 13:27:44 2010
@@ -2,9 +2,14 @@
 from pypy.tool import lib_pypy
 
 def test_lib_pypy_exists():
-    dirname = lib_pypy.get_lib_pypy_dir()
+    dirname = lib_pypy.LIB_PYPY
     assert dirname.check(dir=1)
 
+def test_lib_python_exists():
+    assert lib_pypy.LIB_PYTHON.check(dir=1)
+    assert lib_pypy.LIB_PYTHON_VANILLA.check(dir=1)
+    assert lib_pypy.LIB_PYTHON_MODIFIED.check(dir=1)
+
 def test_import_from_lib_pypy():
     binascii = lib_pypy.import_from_lib_pypy('binascii')
     assert type(binascii) is type(lib_pypy)

Modified: pypy/branch/sys-prefix/pypy/translator/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/benchmark/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/benchmark/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/benchmark/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/c/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/c/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/c/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/c/gcc/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/c/gcc/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/c/gcc/autopath.py	Fri Jun 11 13:27:44 2010
@@ -37,8 +37,7 @@
         partdir = head
         head, tail = os.path.split(head)
         if tail == part:
-            # check if "../py/__init__.py" exists
-            checkfile = os.path.join(partdir, os.pardir, 'py', '__init__.py')
+            checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
             if not os.path.exists(checkfile):
                 error = "Cannot find %r" % (os.path.normpath(checkfile),)
             break
@@ -127,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/c/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/c/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/c/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/cli/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/cli/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/cli/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/geninterplevel.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/geninterplevel.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/geninterplevel.py	Fri Jun 11 13:27:44 2010
@@ -1474,7 +1474,7 @@
     dic = initfunc(space)
     # and now use the members of the dict
     """
-    from pypy.tool.lib_pypy import get_lib_pypy_dir
+    from pypy.tool.lib_pypy import LIB_PYPY
     # create something like a module
     if type(sourcetext) is str:
         code = py.code.Source(sourcetext).compile()
@@ -1486,7 +1486,7 @@
         dic['__file__'] = filename
 
     # XXX allow the app-level code to contain e.g. "import _formatting"
-    libdir = str(get_lib_pypy_dir())
+    libdir = str(LIB_PYPY)
     sys.path.insert(0, libdir)
     try:
         if faked_set:

Modified: pypy/branch/sys-prefix/pypy/translator/goal/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/goal/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/goal/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/goal/test2/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/goal/test2/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/goal/test2/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/goal/test2/test_app_main.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/goal/test2/test_app_main.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/goal/test2/test_app_main.py	Fri Jun 11 13:27:44 2010
@@ -469,17 +469,17 @@
         # setup code for test_get_library_path
         # ------------------------------------
         from pypy.module.sys.version import CPYTHON_VERSION, PYPY_VERSION
-        libroot = 'share/pypy-%d.%d' % PYPY_VERSION[:2]
+        libroot = 'lib/pypy%d.%d' % PYPY_VERSION[:2]
         cpy_ver = '%d.%d.%d' % CPYTHON_VERSION[:3]
         
         goal_dir = os.path.dirname(app_main)
         # build a directory hierarchy like which contains both bin/pypy-c and
-        # share/pypy-1.2/*
+        # lib/pypy1.2/*
         prefix = udir.join('pathtest')
         fake_exe = prefix.join('bin/pypy-c').ensure(file=1)
-        share_pypy = prefix.join(libroot).ensure(dir=1)
-        expected_path = [str(share_pypy.join(subdir).ensure(dir=1))
-                         for subdir in ('pypy/lib',
+        pypyxy = prefix.join(libroot).ensure(dir=1)
+        expected_path = [str(pypyxy.join(subdir).ensure(dir=1))
+                         for subdir in ('lib_pypy',
                                         'lib-python/modified-%s' % cpy_ver,
                                         'lib-python/%s' % cpy_ver)]
         

Modified: pypy/branch/sys-prefix/pypy/translator/microbench/pybench/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/microbench/pybench/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/microbench/pybench/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/sandbox/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/sandbox/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/sandbox/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/sandbox/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/sandbox/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/sandbox/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/test/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/test/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/test/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':

Modified: pypy/branch/sys-prefix/pypy/translator/tool/autopath.py
==============================================================================
--- pypy/branch/sys-prefix/pypy/translator/tool/autopath.py	(original)
+++ pypy/branch/sys-prefix/pypy/translator/tool/autopath.py	Fri Jun 11 13:27:44 2010
@@ -126,8 +126,8 @@
 # set guaranteed attributes
 
 pypydir, this_dir = __dirinfo('pypy')
-import py
-libpythondir = str(py.path.local(pypydir).dirpath().join('lib-python', '2.5.2'))
+import py # note: py is imported only AFTER the path has been set
+libpythondir = str(py.path.local(pypydir).dirpath().join('lib', 'pypy1.2', 'lib-python', '2.5.2'))
 libpythonmodifieddir = str(py.path.local(libpythondir).dirpath().join('modified-2.5.2'))
 
 if __name__ == '__main__':



More information about the Pypy-commit mailing list