diff --git a/emsdk.py b/emsdk.py index 10e1843..d8ba580 100755 --- a/emsdk.py +++ b/emsdk.py @@ -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()