[pypy-commit] pypy py3k: issue1572: fix site-packages missing in sys.path and bring over some other
pjenvey
noreply at buildbot.pypy.org
Fri Aug 2 21:09:24 CEST 2013
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r65913:0ad8f5229df1
Date: 2013-08-02 12:06 -0700
http://bitbucket.org/pypy/pypy/changeset/0ad8f5229df1/
Log: issue1572: fix site-packages missing in sys.path and bring over some
other site.py customizations from default
diff --git a/lib-python/3/site.py b/lib-python/3/site.py
--- a/lib-python/3/site.py
+++ b/lib-python/3/site.py
@@ -57,6 +57,8 @@
import builtins
import traceback
+is_pypy = '__pypy__' in sys.builtin_module_names
+
# Prefixes for site-packages; add additional prefixes like /usr/local here
PREFIXES = [sys.prefix, sys.exec_prefix]
# Enable per user site-packages directory
@@ -284,6 +286,10 @@
if sys.platform in ('os2emx', 'riscos'):
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
+ elif is_pypy:
+ from distutils.sysconfig import get_python_lib
+ sitepackages.append(get_python_lib(standard_lib=False,
+ prefix=prefix))
elif os.sep == '/':
sitepackages.append(os.path.join(prefix, "lib",
"python" + sys.version[:3],
@@ -427,20 +433,27 @@
def setcopyright():
"""Set 'copyright' and 'credits' in builtins"""
+ licenseargs = None
+ if is_pypy:
+ credits = "PyPy is maintained by the PyPy developers: http://pypy.org/"
+ license = "See https://bitbucket.org/pypy/pypy/src/default/LICENSE"
+ licenseargs = (license,)
+ elif sys.platform[:4] == 'java':
+ credits = ("Jython is maintained by the Jython developers "
+ "(www.jython.org).")
+ else:
+ credits = """\
+ Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
+ for supporting Python development. See www.python.org for more information."""
+
builtins.copyright = _Printer("copyright", sys.copyright)
- if sys.platform[:4] == 'java':
- builtins.credits = _Printer(
- "credits",
- "Jython is maintained by the Jython developers (www.jython.org).")
- else:
- builtins.credits = _Printer("credits", """\
- Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
- for supporting Python development. See www.python.org for more information.""")
- here = os.path.dirname(os.__file__)
- builtins.license = _Printer(
- "license", "See http://www.python.org/%.3s/license.html" % sys.version,
- ["LICENSE.txt", "LICENSE"],
- [os.path.join(here, os.pardir), here, os.curdir])
+ builtins.credits = _Printer("credits", credits)
+ if licenseargs is None:
+ here = os.path.dirname(os.__file__)
+ license = "See http://www.python.org/%.3s/license.html" % sys.version
+ licenseargs = (license, ["LICENSE.txt", "LICENSE"],
+ [os.path.join(here, os.pardir), here, os.curdir])
+ builtins.license = _Printer("license", *licenseargs)
class _Helper(object):
More information about the pypy-commit
mailing list