Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r55478:6ce1c997bdd4
Date: 2012-06-07 15:28 +0200
http://bitbucket.org/pypy/pypy/changeset/6ce1c997bdd4/

Log:    we cannot directly import/execute
        pypy.module.sys.state.getinitalpath, because it's a python2 file.
        But the good news is that we don't actually need it: for the tests,
        it is enough to have a minimal path, so we just compute it (in
        particular, we need to be able to import _pypy_interact)

diff --git a/pypy/translator/goal/app_main.py b/pypy/translator/goal/app_main.py
--- a/pypy/translator/goal/app_main.py
+++ b/pypy/translator/goal/app_main.py
@@ -774,12 +774,11 @@
     sys.modules['__cpython_main__'] = sys.modules['__main__']
 
     def pypy_initial_path(s):
-        return ["../lib-python/3.2", "../lib_pypy", ".."]
-        from pypy.module.sys.state import getinitialpath
-        try:
-            return getinitialpath(None, s)
-        except OSError:
-            return None
+        from os.path import abspath, join, dirname as dn
+        thisfile = os.path.abspath(__file__)
+        root = dn(dn(dn(dn(thisfile))))
+        return [join(root, 'lib-python', '3.2'),
+                join(root, 'lib_pypy')]
     sys.pypy_initial_path = pypy_initial_path
 
     # add an emulator for these pypy-only or 2.7-only functions
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to