Commit 46a82989 authored by Jason R. Coombs's avatar Jason R. Coombs

Use API for loading the CLI launcher for Windows from setuptools (currently unreleased).

parent 11571375
...@@ -1104,6 +1104,10 @@ def _create_script(contents, dest): ...@@ -1104,6 +1104,10 @@ def _create_script(contents, dest):
if win32_exe.endswith('-script'): if win32_exe.endswith('-script'):
win32_exe = win32_exe[:-7] # remove "-script" win32_exe = win32_exe[:-7] # remove "-script"
win32_exe = win32_exe + '.exe' # add ".exe" win32_exe = win32_exe + '.exe' # add ".exe"
try:
new_data = setuptools.command.easy_install.get_win_launcher('cli')
except AttributeError:
# fall back for compatibility with older Distribute versions
new_data = pkg_resources.resource_string('setuptools', 'cli.exe') new_data = pkg_resources.resource_string('setuptools', 'cli.exe')
if (not os.path.exists(win32_exe) or if (not os.path.exists(win32_exe) or
(open(win32_exe, 'rb').read() != new_data) (open(win32_exe, 'rb').read() != new_data)
......
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