[pypy-svn] r76174 - pypy/trunk/lib-python/modified-2.5.2

fijal at codespeak.net fijal at codespeak.net
Tue Jul 13 11:43:34 CEST 2010

Author: fijal
Date: Tue Jul 13 11:43:33 2010
New Revision: 76174

sys.prefix is there only if the path was succesfully found. Don't crash at 'import site' in the case we are using the builtin path

Modified: pypy/trunk/lib-python/modified-2.5.2/site.py
--- pypy/trunk/lib-python/modified-2.5.2/site.py	(original)
+++ pypy/trunk/lib-python/modified-2.5.2/site.py	Tue Jul 13 11:43:33 2010
@@ -175,7 +175,7 @@
 def addsitepackages(known_paths):
     """Add site-packages to sys.path, in a PyPy-specific way."""
-    if hasattr(sys, 'pypy_version_info'):
+    if hasattr(sys, 'pypy_version_info') and hasattr(sys, 'prefix'):
         from distutils.sysconfig import get_python_lib
         sitedir = get_python_lib(standard_lib=False)
         if os.path.isdir(sitedir):

More information about the Pypy-commit mailing list