Commit 08d66abe authored by Reinout van Rees's avatar Reinout van Rees

Fixed #79

When generating a python interpreter script with an empty `eggs=`,
previously you'd get `sys.path[0:0] = [,]`, which means a syntax
error because of the dangling comma.
parent 5661e9c2
......@@ -1157,6 +1157,8 @@ def _pyscript(path, dest, rsetup, initialization=''):
dest += '-script.py'
python = _safe_arg(sys.executable)
if path:
path += ',' # Courtesy comma at the end of the list.
contents = py_script_template % dict(
python = python,
......@@ -1191,7 +1193,7 @@ py_script_template = script_header + '''\
import sys
sys.path[0:0] = [
%(path)s,
%(path)s
]
%(initialization)s
......
......@@ -681,15 +681,14 @@ An interpreter can also be generated without other eggs:
>>> scripts = zc.buildout.easy_install.scripts(
... [], [], sys.executable, bin, interpreter='py')
>>> cat(bin, 'py') # doctest: +NORMALIZE_WHITESPACE
>>> cat(bin, 'py') # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
#!/usr/local/bin/python2.7
<BLANKLINE>
import sys
<BLANKLINE>
sys.path[0:0] = [
]
<BLANKLINE>
_interactive = True
]
...
An additional argument can be passed to define which scripts to install
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment