Commit 422d4394 authored by Jim Fulton's avatar Jim Fulton

Don't write .exe files if the files exist and are the same. This makes

stupid windows errors less likely.
parent 61579d28
...@@ -925,9 +925,10 @@ def _script(module_name, attrs, path, dest, executable, arguments, ...@@ -925,9 +925,10 @@ 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:
exe = script+'.exe' exe = script+'.exe'
open(exe, 'wb').write( new_data = pkg_resources.resource_string('setuptools', 'cli.exe')
pkg_resources.resource_string('setuptools', 'cli.exe') if not os.path.exists(exe) or (open(exe, 'rb').read() != new_data):
) # Only write it if it's different.
open(exe, 'wb').write(new_data)
generated.append(exe) generated.append(exe)
if changed: if changed:
......
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