Opened 12 years ago

Closed 12 years ago

#32335 closed defect (fixed)

pypy-c wrapper script breaks some command-line usages of pypy

Reported by: macports.org@… Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: haspatch Cc:
Port: pypy

Description

> python2.7 -mtimeit -s 'import random' 'random.random()'   
10000000 loops, best of 3: 0.116 usec per loop
> pypy-c -mtimeit -s 'import random' 'random.random()'          
Traceback (most recent call last):
  File "app_main.py", line 51, in run_toplevel
  File "/opt/local/lib/pypy/lib-python/2.7/runpy.py", line 162, in _run_module_as_
    "__main__", fname, loader, pkg_name)
  File "/opt/local/lib/pypy/lib-python/2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opt/local/lib/pypy/lib-python/2.7/timeit.py", line 328, in <module>
    sys.exit(main())
  File "/opt/local/lib/pypy/lib-python/2.7/timeit.py", line 292, in main
    t = Timer(stmt, setup, timer)
  File "/opt/local/lib/pypy/lib-python/2.7/timeit.py", line 136, in __init__
    code = compile(src, dummy_src_name, "exec")
  File "<timeit-src>", line 3
    import
         ^
SyntaxError: invalid syntax

The problem is that Macports's wrapper pypy-c script uses a raw $@ to proxy the arguments to the actual pypy binary, which "unpacks" them. $@ should be quoted, or the script should be replaced by a symlink.

As I'm not sure how to setup symlinks via portfiles, I'll just link a patch to correctly quoting the file in question.

Attachments (1)

pypy.patch (170 bytes) - added by macports.org@… 12 years ago.

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by macports.org@…

Attachment: pypy.patch added

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: jmr@macports.org removed
Owner: changed from macports-tickets@… to jmr@…

comment:2 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added

comment:3 Changed 12 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.