Commit 1f0f0a4c authored by jim's avatar jim

Fixed careless bug in computation of exe file names.

Also rearranged some code to work with emacs python mode. :)


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@76852 62d5b8a3-27da-0310-9561-8e5933582275
parent 93a6d4ce
......@@ -28,11 +28,13 @@ import setuptools.package_index
import setuptools.archive_util
import zc.buildout
def realpath(path):
return path
try:
realpath = os.path.realpath
except AttributeError:
def realpath(path):
return path
pass
default_index_url = os.environ.get('buildout-testing-index-url')
......@@ -841,6 +843,7 @@ def _script(module_name, attrs, path, dest, executable, arguments,
script = dest
if sys.platform == 'win32':
dest += '-script.py'
contents = script_template % dict(
python = executable,
path = path,
......@@ -853,10 +856,11 @@ def _script(module_name, attrs, path, dest, executable, arguments,
if sys.platform == 'win32':
# generate exe file and give the script a magic name:
open(dest+'.exe', 'wb').write(
exe = script+'.exe'
open(exe, 'wb').write(
pkg_resources.resource_string('setuptools', 'cli.exe')
)
generated.append(dest+'.exe')
generated.append(exe)
if changed:
open(dest, 'w').write(contents)
......@@ -899,10 +903,11 @@ def _pyscript(path, dest, executable):
if sys.platform == 'win32':
# generate exe file and give the script a magic name:
open(dest+'.exe', 'wb').write(
exe = script + '.exe'
open(exe, 'wb').write(
pkg_resources.resource_string('setuptools', 'cli.exe')
)
generated.append(dest+'.exe')
generated.append(exe)
if changed:
open(dest, 'w').write(contents)
......
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