[pypy-commit] pypy py3k: merge default

pjenvey noreply at buildbot.pypy.org
Wed May 1 22:21:57 CEST 2013


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r63788:8c0da4a921de
Date: 2013-05-01 13:05 -0700
http://bitbucket.org/pypy/pypy/changeset/8c0da4a921de/

Log:	merge default

diff --git a/lib-python/2.7/distutils/command/install.py b/lib-python/2.7/distutils/command/install.py
--- a/lib-python/2.7/distutils/command/install.py
+++ b/lib-python/2.7/distutils/command/install.py
@@ -474,8 +474,8 @@
 
     def select_scheme (self, name):
         # it's the caller's problem if they supply a bad name!
-        if hasattr(sys, 'pypy_version_info') and not (
-                name.endswith('_user') or name.endswith('_home')):
+        if (hasattr(sys, 'pypy_version_info') and
+            not name.endswith(('_user', '_home'))):
             name = 'pypy'
         scheme = INSTALL_SCHEMES[name]
         for key in SCHEME_KEYS:
diff --git a/pypy/interpreter/app_main.py b/pypy/interpreter/app_main.py
--- a/pypy/interpreter/app_main.py
+++ b/pypy/interpreter/app_main.py
@@ -1,25 +1,42 @@
 #! /usr/bin/env python
 # App-level version of py.py.
 # See test/test_app_main.
+
+# Missing vs CPython: -B, -d, -OO, -t, -v, -x, -3
+"""\
+Options and arguments (and corresponding environment variables):
+-c cmd : program passed in as string (terminates option list)
+-E     : ignore PYTHON* environment variables (such as PYTHONPATH)
+-h     : print this help message and exit (also --help)
+-i     : inspect interactively after running script; forces a prompt even
+         if stdin does not appear to be a terminal; also PYTHONINSPECT=x
+-m mod : run library module as a script (terminates option list)
+-O     : dummy optimization flag for compatibility with CPython
+-R     : ignored (see http://bugs.python.org/issue14621)
+-Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew
+-s     : don't add user site directory to sys.path; also PYTHONNOUSERSITE
+-S     : don't imply 'import site' on initialization
+-u     : unbuffered binary stdout and stderr; also PYTHONUNBUFFERED=x
+-V     : print the Python version number and exit (also --version)
+-W arg : warning control; arg is action:message:category:module:lineno
+         also PYTHONWARNINGS=arg
+file   : program read from script file
+-      : program read from stdin (default; interactive mode if a tty)
+arg ...: arguments passed to program in sys.argv[1:]
+PyPy options and arguments:
+--info : print translation information about this PyPy executable
 """
-options:
-  -i             inspect interactively after running script
-  -O             dummy optimization flag for compatibility with C Python
-  -c cmd         program passed in as CMD (terminates option list)
-  -S             do not 'import site' on initialization
-  -u             unbuffered binary stdout and stderr
-  -h, --help     show this help message and exit
-  -m mod         library module to be run as a script (terminates option list)
-  -W arg         warning control (arg is action:message:category:module:lineno)
-  -X opt         set implementation-specific option
-  -E             ignore environment variables (such as PYTHONPATH)
-  -R             ignored (see http://bugs.python.org/issue14621)
-  --version      print the PyPy version
-  --info         print translation information about this PyPy executable
+from __future__ import print_function, unicode_literals
+USAGE1 = __doc__
+# Missing vs CPython: PYTHONHOME, PYTHONCASEOK
+USAGE2 = """
+Other environment variables:
+PYTHONSTARTUP: file executed on interactive startup (no default)
+PYTHONPATH   : %r-separated list of directories prefixed to the
+               default module search path.  The result is sys.path.
+PYTHONIOENCODING: Encoding[:errors] used for stdin/stdout/stderr.
 """
 
-from __future__ import print_function, unicode_literals
-
 try:
     from __pypy__ import hidden_applevel
 except ImportError:
@@ -133,13 +150,14 @@
     raise SystemExit
 
 def print_help(*args):
+    import os
     initstdio()
-    print('usage: %s [options] [-c cmd|-m mod|file.py|-] [arg...]' % (
+    print('usage: %s [option] ... [-c cmd | -m mod | file | -] [arg] ...' % (
         sys.executable,))
-    print(__doc__.rstrip())
+    print(USAGE1, end='')
     if 'pypyjit' in sys.builtin_module_names:
-        print("  --jit OPTIONS  advanced JIT options: try 'off' or 'help'")
-    print()
+        print("--jit options: advanced JIT options: try 'off' or 'help'")
+    print(USAGE2 % (os.pathsep,), end='')
     raise SystemExit
 
 def _print_jit_help():
diff --git a/pypy/interpreter/test2/test_app_main.py b/pypy/interpreter/test2/test_app_main.py
--- a/pypy/interpreter/test2/test_app_main.py
+++ b/pypy/interpreter/test2/test_app_main.py
@@ -273,7 +273,8 @@
         # test that -h prints the usage, including the name of the executable
         # which should be /full/path/to/app_main.py in this case
         child = self.spawn(['-h'])
-        child.expect(r'usage: .*app_main.py \[options\]')
+        child.expect(r'usage: .*app_main.py \[option\]')
+        child.expect('PyPy options and arguments:')
 
     def test_run_script(self, demo_script):
         child = self.spawn([demo_script])
diff --git a/pypy/module/__builtin__/test/test_zip.py b/pypy/module/__builtin__/test/test_zip.py
--- a/pypy/module/__builtin__/test/test_zip.py
+++ b/pypy/module/__builtin__/test/test_zip.py
@@ -13,6 +13,12 @@
     def test_one_list(self):
         assert list(zip([1, 2, 3])) == [(1,), (2,), (3,)]
 
+    def test_two_lists(self):
+        # uses a different code path
+        assert zip([1, 2, 3], [3, 4, 5]) == [(1, 3), (2, 4), (3, 5)]
+        assert zip([1, 2, 3], [3, 4]) == [(1, 3), (2, 4)]
+        assert zip([1, 2], [3, 4, 5]) == [(1, 3), (2, 4)]
+
     def test_three_lists_same_size(self):
         assert list(zip([1, 2, 3], [3, 4, 5], [6, 7, 8])) == (
                           [(1, 3, 6), (2, 4, 7), (3, 5, 8)])
diff --git a/rpython/translator/platform/arm.py b/rpython/translator/platform/arm.py
--- a/rpython/translator/platform/arm.py
+++ b/rpython/translator/platform/arm.py
@@ -18,8 +18,11 @@
 class ARM(Linux):
     name = "arm"
 
-    available_librarydirs = [SB2 + '/usr/lib/arm-linux-gnueabi/',
+    available_librarydirs = [SB2 + '/lib/arm-linux-gnueabi/',
+                             SB2 + '/lib/arm-linux-gnueabihf/',
+                             SB2 + '/usr/lib/arm-linux-gnueabi/',
                              SB2 + '/usr/lib/arm-linux-gnueabihf/']
+
     available_includedirs = [SB2 + '/usr/include/arm-linux-gnueabi/',
                              SB2 + '/usr/include/arm-linux-gnueabihf/']
     copied_cache = {}


More information about the pypy-commit mailing list