Commit e525ab42 authored by Xavier Thompson's avatar Xavier Thompson

WIP Fix

parent fc7b9c40
......@@ -42,7 +42,7 @@ def get_distributions():
def get_paths():
paths = set(dist.location for dist in get_distributions())
paths = {dist.location for dist in get_distributions()}
return [path for path in sys.path if path in paths]
......@@ -121,8 +121,10 @@ Buildout will be restarted automatically to have this change applied.
'import sys; sys.exit(sys.version_info[:2] == %r)'
% (sys.version_info[:2],))):
setup_script(new_bin, self.wanted_python)
shutil.copy(new_bin, installed)
else:
shutil.move(installed, installed + '-old')
old = installed + '-old'
shutil.move(installed, old)
try:
paths = get_paths()
args = [arg for arg in sys.argv if arg.startswith('buildout:')]
......@@ -133,7 +135,7 @@ Buildout will be restarted automatically to have this change applied.
"sys.argv[1:1]=%r ; "
"zc.buildout.buildout.main()" % (paths, args + ['bootstrap'])])
except subprocess.CalledProcessError:
shutil.move(installed + '-old', installed)
shutil.move(old, installed)
raise
shutil.copy(installed, new_bin)
os.execve(self.wanted_python, [self.wanted_python] + sys.argv, self.environ)
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