Do not attempt to reinstall python if it already exists (#394)

* Do not attempt to reinstall python if it already exists, since that python may be interpreting the current emsdk.py script that is being executed to do the installation.

* Add TODO comment about refactoring install scheme
This commit is contained in:
juj
2019-12-05 17:59:21 +02:00
committed by GitHub
parent 2c1cb5a2be
commit cf90c72aba

View File

@@ -1698,6 +1698,15 @@ class Tool(object):
print("Done installing SDK '" + str(self) + "'.")
return True
else:
# We should not force reinstallation of python if it already exists, since that very python
# may be interpreting the current emsdk.py script we are executing. On Windows this would
# lead to a failure to uncompress the python zip file as the python executable files are in use.
# TODO: Refactor codebase to avoid needing this kind of special case check by being more
# careful about reinstallation, see https://github.com/emscripten-core/emsdk/pull/394#issuecomment-559386468
# for a scheme that would work.
if self.id == 'python' and self.is_installed():
print("Skipped installing " + self.name + ", already installed.")
return True
print("Installing tool '" + str(self) + "'..")
url = self.download_url()