# HG changeset patch # User Panos Astithas # Date 1543537548 0 # Node ID 305c06df7740f4b2393c53dae175f0d199f3e30b # Parent 1e64f8c3f949bb16b4981f255033021b42118586 Bug 1508184 - Don't try to set the active python during bootstrap if not necessary r=gps Differential Revision: https://phabricator.services.mozilla.com/D12237 diff --git a/python/mozboot/mozboot/osx.py b/python/mozboot/mozboot/osx.py --- a/python/mozboot/mozboot/osx.py +++ b/python/mozboot/mozboot/osx.py @@ -405,17 +405,26 @@ class OSXBootstrapper(BaseBootstrapper): 'mercurial', 'autoconf213', 'gnutar', 'watchman', 'nodejs8' ] self._ensure_macports_packages(packages) - self.run_as_root([self.port, 'select', '--set', 'python', 'python27']) + + pythons = set(self.check_output([self.port, 'select', '--list', 'python']).split('\n')) + active = '' + for python in pythons: + if 'active' in python: + active = python + if 'python27' not in active: + self.run_as_root([self.port, 'select', '--set', 'python', 'python27']) + else: + print('The right python version is already active.') def ensure_macports_browser_packages(self, artifact_mode=False): # TODO: Figure out what not to install for artifact mode packages = [ 'nasm', 'yasm', 'llvm-7.0', 'clang-7.0',