Commits

Philip Jenvey  committed 8c0da4a Merge

merge default

  • Participants
  • Parent commits 1e65627, 1208c73
  • Branches py3k

Comments (0)

Files changed (6)

File lib-python/2.7/distutils/command/install.py

 
     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:

File pypy/interpreter/app_main.py

 #! /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:
     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():

File pypy/interpreter/test2/test_app_main.py

         # 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])

File pypy/module/__builtin__/app_functional.py

File contents unchanged.

File pypy/module/__builtin__/test/test_zip.py

     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)])

File rpython/translator/platform/arm.py

 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 = {}