Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r87390:0e3b02bb98e5
Date: 2016-09-26 10:15 +0200
http://bitbucket.org/pypy/pypy/changeset/0e3b02bb98e5/

Log:    Search first around the pypy executable (like previously), and only
        when not found search around the libpypy-c.so

diff --git a/pypy/goal/targetpypystandalone.py 
b/pypy/goal/targetpypystandalone.py
--- a/pypy/goal/targetpypystandalone.py
+++ b/pypy/goal/targetpypystandalone.py
@@ -93,12 +93,10 @@
             home1 = rffi.charp2str(ll_home)
             home = os.path.join(home1, 'x') # <- so that 'll_home' can be
                                             # directly the root directory
-            dynamic = False
         else:
             home1 = "pypy's shared library location"
-            home = pypydir
-            dynamic = True
-        w_path = pypy_find_stdlib(space, home, dynamic)
+            home = '*'
+        w_path = pypy_find_stdlib(space, home)
         if space.is_none(w_path):
             if verbose:
                 debug("pypy_setup_home: directories 'lib-python' and 
'lib_pypy'"
diff --git a/pypy/module/sys/initpath.py b/pypy/module/sys/initpath.py
--- a/pypy/module/sys/initpath.py
+++ b/pypy/module/sys/initpath.py
@@ -157,16 +157,20 @@
     return space.wrap(resolvedirof(filename))
 
 
-@unwrap_spec(executable='str0', dynamic=int)
-def pypy_find_stdlib(space, executable, dynamic=1):
-    if dynamic and space.config.translation.shared:
-        dynamic_location = pypy_init_home()
-        if dynamic_location:
-            executable = rffi.charp2str(dynamic_location)
-            pypy_init_free(dynamic_location)
-    path, prefix = find_stdlib(get_state(space), executable)
+@unwrap_spec(executable='str0')
+def pypy_find_stdlib(space, executable):
+    path, prefix = None, None
+    if executable != '*':
+        path, prefix = find_stdlib(get_state(space), executable)
     if path is None:
-        return space.w_None
+        if space.config.translation.shared:
+            dynamic_location = pypy_init_home()
+            if dynamic_location:
+                dyn_path = rffi.charp2str(dynamic_location)
+                pypy_init_free(dynamic_location)
+                path, prefix = find_stdlib(get_state(space), dyn_path)
+        if path is None:
+            return space.w_None
     w_prefix = space.wrap(prefix)
     space.setitem(space.sys.w_dict, space.wrap('prefix'), w_prefix)
     space.setitem(space.sys.w_dict, space.wrap('exec_prefix'), w_prefix)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to