Commit be208c05 authored by Jim Fulton's avatar Jim Fulton

Fixed careless bug in computation of exe file names.

Also rearranged some code to work with emacs python mode. :)
parent 85629419
...@@ -28,11 +28,13 @@ import setuptools.package_index ...@@ -28,11 +28,13 @@ import setuptools.package_index
import setuptools.archive_util import setuptools.archive_util
import zc.buildout import zc.buildout
def realpath(path):
return path
try: try:
realpath = os.path.realpath realpath = os.path.realpath
except AttributeError: except AttributeError:
def realpath(path): pass
return path
default_index_url = os.environ.get('buildout-testing-index-url') default_index_url = os.environ.get('buildout-testing-index-url')
...@@ -841,6 +843,7 @@ def _script(module_name, attrs, path, dest, executable, arguments, ...@@ -841,6 +843,7 @@ def _script(module_name, attrs, path, dest, executable, arguments,
script = dest script = dest
if sys.platform == 'win32': if sys.platform == 'win32':
dest += '-script.py' dest += '-script.py'
contents = script_template % dict( contents = script_template % dict(
python = executable, python = executable,
path = path, path = path,
...@@ -853,10 +856,11 @@ def _script(module_name, attrs, path, dest, executable, arguments, ...@@ -853,10 +856,11 @@ def _script(module_name, attrs, path, dest, executable, arguments,
if sys.platform == 'win32': if sys.platform == 'win32':
# generate exe file and give the script a magic name: # 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') pkg_resources.resource_string('setuptools', 'cli.exe')
) )
generated.append(dest+'.exe') generated.append(exe)
if changed: if changed:
open(dest, 'w').write(contents) open(dest, 'w').write(contents)
...@@ -899,10 +903,11 @@ def _pyscript(path, dest, executable): ...@@ -899,10 +903,11 @@ def _pyscript(path, dest, executable):
if sys.platform == 'win32': if sys.platform == 'win32':
# generate exe file and give the script a magic name: # 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') pkg_resources.resource_string('setuptools', 'cli.exe')
) )
generated.append(dest+'.exe') generated.append(exe)
if changed: if changed:
open(dest, 'w').write(contents) 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