Bug 1361912 - Stop defining python2.7 executable as sys.executable; r=ted
authorGregory Szorc <gps@mozilla.com>
Wed, 03 May 2017 18:10:33 -0700
changeset 576514 23050ffaf6490bb3d7811d586eb174b3c85fd4d6
parent 576513 402ef9d842a347123d2ba8acf22679272b330f8c
child 576515 6a82d640aa274f6532528bd45d9e86ede901f44d
push id58380
push usergszorc@mozilla.com
push dateThu, 11 May 2017 19:43:38 +0000
reviewersted
bugs1361912
milestone55.0a1
Bug 1361912 - Stop defining python2.7 executable as sys.executable; r=ted The "python2.7" executable is always defined as sys.executable in mozharness configs. This abstraction is not necessary. This commit removes the "python2.7" executable from mozharness configs and just inlines sys.executable instead. MozReview-Commit-ID: 4xiEkoFwekr
testing/mozharness/configs/builds/releng_base_mac_64_builds.py
testing/mozharness/configs/builds/releng_base_mac_64_cross_builds.py
testing/mozharness/configs/builds/releng_base_windows_32_builds.py
testing/mozharness/configs/builds/releng_base_windows_64_builds.py
testing/mozharness/configs/builds/releng_sub_mac_configs/64_artifact.py
testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug_artifact.py
testing/mozharness/configs/builds/taskcluster_firefox_win32_clang.py
testing/mozharness/configs/builds/taskcluster_firefox_win32_clang_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_opt.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_clang.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_clang_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_opt.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py
testing/mozharness/configs/single_locale/win32.py
testing/mozharness/configs/single_locale/win64.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
testing/mozharness/mozharness/mozilla/l10n/locales.py
testing/mozharness/scripts/desktop_l10n.py
testing/mozharness/scripts/desktop_partner_repacks.py
testing/mozharness/scripts/repackage.py
--- a/testing/mozharness/configs/builds/releng_base_mac_64_builds.py
+++ b/testing/mozharness/configs/builds/releng_base_mac_64_builds.py
@@ -14,17 +14,16 @@ config = {
         'generate-build-stats',
         'upload-files',
         'sendchange',
         'check-test',
         'update',  # decided by query_is_nightly()
     ],
     "buildbot_json_path": "buildprops.json",
     'exes': {
-        'python2.7': sys.executable,
         "buildbot": "/tools/buildbot/bin/buildbot",
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'enable_ccache': True,
     'vcs_share_base': '/builds/hg-shared',
     'objdir': 'obj-firefox',
--- a/testing/mozharness/configs/builds/releng_base_mac_64_cross_builds.py
+++ b/testing/mozharness/configs/builds/releng_base_mac_64_cross_builds.py
@@ -11,17 +11,16 @@ config = {
         'clone-tools',
         'checkout-sources',
         'build',
         'generate-build-stats',
         'update',  # decided by query_is_nightly()
     ],
     "buildbot_json_path": "buildprops.json",
     'exes': {
-        'python2.7': sys.executable,
         "buildbot": "/tools/buildbot/bin/buildbot",
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': True,
     'secret_files': [
         {'filename': '/builds/gapi.data',
          'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/gapi.data',
--- a/testing/mozharness/configs/builds/releng_base_windows_32_builds.py
+++ b/testing/mozharness/configs/builds/releng_base_windows_32_builds.py
@@ -18,17 +18,16 @@ config = {
         'generate-build-stats',
         'upload-files',
         'sendchange',
         'check-test',
         'update',  # decided by query_is_nightly()
     ],
     "buildbot_json_path": "buildprops.json",
     'exes': {
-        'python2.7': sys.executable,
         "buildbot": [
             sys.executable,
             'c:\\mozilla-build\\buildbotve\\scripts\\buildbot'
         ],
         'virtualenv': [
             sys.executable,
             'c:/mozilla-build/buildbotve/virtualenv.py'
         ],
--- a/testing/mozharness/configs/builds/releng_base_windows_64_builds.py
+++ b/testing/mozharness/configs/builds/releng_base_windows_64_builds.py
@@ -18,17 +18,16 @@ config = {
         'generate-build-stats',
         'upload-files',
         'sendchange',
         'check-test',
         'update',  # decided by query_is_nightly()
     ],
     "buildbot_json_path": "buildprops.json",
     'exes': {
-        'python2.7': sys.executable,
         "buildbot": [
             sys.executable,
             'c:\\mozilla-build\\buildbotve\\scripts\\buildbot'
         ],
         'virtualenv': [
             sys.executable,
             'c:/mozilla-build/buildbotve/virtualenv.py'
         ],
--- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_artifact.py
+++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_artifact.py
@@ -10,17 +10,16 @@ config = {
         'clone-tools',
         # 'setup-mock',
         'checkout-sources',
         'build',
         'sendchange',
     ],
     "buildbot_json_path": "buildprops.json",
     'exes': {
-        'python2.7': sys.executable,
         "buildbot": "/tools/buildbot/bin/buildbot",
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': False,
     'enable_ccache': True,
     'vcs_share_base': '/builds/hg-shared',
     'objdir': 'obj-firefox',
--- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug_artifact.py
+++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug_artifact.py
@@ -12,17 +12,16 @@ config = {
         'clone-tools',
         # 'setup-mock',
         'checkout-sources',
         'build',
         'sendchange',
     ],
     "buildbot_json_path": "buildprops.json",
     'exes': {
-        'python2.7': sys.executable,
         "buildbot": "/tools/buildbot/bin/buildbot",
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
     # decides whether we want to use moz_sign_cmd in env
     'enable_signing': False,
     'enable_ccache': True,
     'vcs_share_base': '/builds/hg-shared',
     'objdir': MOZ_OBJDIR,
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang.py
@@ -17,17 +17,16 @@ config = {
     # - taskcluster_firefox_win64_clang_debug
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_clang_debug.py
@@ -17,17 +17,16 @@ config = {
     # - taskcluster_firefox_win64_clang_debug
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_debug.py
@@ -18,17 +18,16 @@ config = {
 
     'default_actions': [
         'clone-tools',
         'build',
         'generate-build-stats',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win32_qr_opt.py
@@ -18,17 +18,16 @@ config = {
 
     'default_actions': [
         'clone-tools',
         'build',
         'generate-build-stats',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_debug.py
@@ -17,17 +17,16 @@ config = {
     # - taskcluster_firefox_win64_clang_debug
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_asan_opt.py
@@ -17,17 +17,16 @@ config = {
     # - taskcluster_firefox_win64_clang_debug
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang.py
@@ -17,17 +17,16 @@ config = {
     # - taskcluster_firefox_win64_clang_debug
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_clang_debug.py
@@ -17,17 +17,16 @@ config = {
     # - taskcluster_firefox_win64_clang_debug
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_debug.py
@@ -13,17 +13,16 @@ config = {
     # - taskcluster_firefox_win64_opt
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_win64_qr_opt.py
@@ -13,17 +13,16 @@ config = {
     # - taskcluster_firefox_win64_opt
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_addondevel.py
@@ -18,17 +18,16 @@ config = {
 
     'default_actions': [
         'clone-tools',
         'build',
         'generate-build-stats',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py
@@ -18,17 +18,16 @@ config = {
 
     'default_actions': [
         'clone-tools',
         'build',
         'generate-build-stats',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py
@@ -18,17 +18,16 @@ config = {
 
     'default_actions': [
         'clone-tools',
         'build',
         'generate-build-stats',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_addondevel.py
@@ -19,17 +19,16 @@ config = {
 
     'default_actions': [
         'clone-tools',
         'build',
         'generate-build-stats',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py
@@ -18,17 +18,16 @@ config = {
 
     'default_actions': [
         'clone-tools',
         'build',
         'generate-build-stats',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py
@@ -18,17 +18,16 @@ config = {
 
     'default_actions': [
         'clone-tools',
         'build',
         'generate-build-stats',
         'check-test',
     ],
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'python', 'virtualenv', 'virtualenv.py'
             )
         ],
     },
     'app_ini_path': '%(obj_dir)s/dist/bin/application.ini',
--- a/testing/mozharness/configs/single_locale/win32.py
+++ b/testing/mozharness/configs/single_locale/win32.py
@@ -63,15 +63,14 @@ config = {
     "complete_mar": "firefox-%(version)s.en-US.win32.complete.mar",
     "localized_mar": "firefox-%(version)s.%(locale)s.win32.complete.mar",
     "partial_mar": "firefox-%(version)s.%(locale)s.win32.partial.%(from_buildid)s-%(to_buildid)s.mar",
     'installer_file': "firefox-%(version)s.en-US.win32.installer.exe",
 
     # use mozmake?
     "enable_mozmake": True,
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             'c:/mozilla-build/buildbotve/virtualenv.py'
         ],
     }
 }
--- a/testing/mozharness/configs/single_locale/win64.py
+++ b/testing/mozharness/configs/single_locale/win64.py
@@ -63,15 +63,14 @@ config = {
     "complete_mar": "firefox-%(version)s.en-US.win64.complete.mar",
     "localized_mar": "firefox-%(version)s.%(locale)s.win64.complete.mar",
     "partial_mar": "firefox-%(version)s.%(locale)s.win64.partial.%(from_buildid)s-%(to_buildid)s.mar",
     'installer_file': "firefox-%(version)s.en-US.win64.installer.exe",
 
     # use mozmake?
     "enable_mozmake": True,
     'exes': {
-        'python2.7': sys.executable,
         'virtualenv': [
             sys.executable,
             'c:/mozilla-build/buildbotve/virtualenv.py'
         ],
     }
 }
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -745,19 +745,18 @@ or run without that action (ie: --no-{ac
         print_conf_setting_path = os.path.join(dirs['abs_src_dir'],
                                                'config',
                                                'printconfigsetting.py')
         if not app_ini_path:
             # set the default
             app_ini_path = dirs['abs_app_ini_path']
         if (os.path.exists(print_conf_setting_path) and
                 os.path.exists(app_ini_path)):
-            python = self.query_exe('python2.7')
             cmd = [
-                python, os.path.join(dirs['abs_src_dir'], 'mach'), 'python',
+                sys.executable, os.path.join(dirs['abs_src_dir'], 'mach'), 'python',
                 print_conf_setting_path, app_ini_path,
                 'App', prop
             ]
             env = self.query_build_env()
             # dirs['abs_obj_dir'] can be different from env['MOZ_OBJDIR'] on
             # mac, and that confuses mach.
             del env['MOZ_OBJDIR']
             return self.get_output_from_command_m(cmd,
@@ -1130,19 +1129,18 @@ or run without that action (ie: --no-{ac
             'build'
         )
         c = self.config
         dirs = self.query_abs_dirs()
         if not c.get('tooltool_manifest_src'):
             return self.warning(ERROR_MSGS['tooltool_manifest_undetermined'])
         tooltool_manifest_path = os.path.join(dirs['abs_src_dir'],
                                               c['tooltool_manifest_src'])
-        python = self.query_exe('python2.7')
         cmd = [
-            python, '-u',
+            sys.executable, '-u',
             os.path.join(dirs['abs_src_dir'], 'mach'),
             'artifact',
             'toolchain',
             '-v',
             '--retry', '4',
             '--tooltool-manifest',
             tooltool_manifest_path,
             '--tooltool-url',
@@ -1300,19 +1298,18 @@ or run without that action (ie: --no-{ac
             self.log("Can't set the following properties: "
                      "buildid, sourcestamp, appVersion, and appName. "
                      "Required paths missing. Verify both %s and %s "
                      "exist. These paths require the 'build' action to be "
                      "run prior to this" % (print_conf_setting_path,
                                             dirs['abs_app_ini_path']),
                      level=error_level)
         self.info("Setting properties found in: %s" % dirs['abs_app_ini_path'])
-        python = self.query_exe('python2.7')
         base_cmd = [
-            python, os.path.join(dirs['abs_src_dir'], 'mach'), 'python',
+            sys.executable, os.path.join(dirs['abs_src_dir'], 'mach'), 'python',
             print_conf_setting_path, dirs['abs_app_ini_path'], 'App'
         ]
         properties_needed = [
             {'ini_name': 'SourceStamp', 'prop_name': 'sourcestamp'},
             {'ini_name': 'Version', 'prop_name': 'appVersion'},
             {'ini_name': 'Name', 'prop_name': 'appName'}
         ]
         env = self.query_build_env()
@@ -1639,17 +1636,17 @@ or run without that action (ie: --no-{ac
                 os.path.join(dirs['abs_work_dir'], 'buildprops.json'))
 
         if 'MOZILLABUILD' in os.environ:
             mach = [
                 os.path.join(os.environ['MOZILLABUILD'], 'msys', 'bin', 'bash.exe'),
                 os.path.join(dirs['abs_src_dir'], 'mach')
             ]
         else:
-            mach = [self.query_exe('python2.7'), 'mach']
+            mach = [sys.executable, 'mach']
 
         return_code = self.run_command_m(
             command=mach + ['--log-no-times', 'build', '-v'],
             cwd=dirs['abs_src_dir'],
             env=env,
             output_timeout=self.config.get('max_build_output_timeout', 60 * 40)
         )
         if return_code:
@@ -1763,40 +1760,38 @@ or run without that action (ie: --no-{ac
         # A list of argument lists.  Better names gratefully accepted!
         mach_commands = self.config.get('postflight_build_mach_commands', [])
         for mach_command in mach_commands:
             self._execute_postflight_build_mach_command(mach_command)
 
     def _execute_postflight_build_mach_command(self, mach_command_args):
         env = self.query_build_env()
         env.update(self.query_mach_build_env())
-        python = self.query_exe('python2.7')
 
-        command = [python, 'mach', '--log-no-times']
+        command = [sys.executable, 'mach', '--log-no-times']
         command.extend(mach_command_args)
 
         self.run_command_m(
             command=command,
             cwd=self.query_abs_dirs()['abs_src_dir'],
             env=env, output_timeout=self.config.get('max_build_output_timeout', 60 * 20),
             halt_on_failure=True,
         )
 
     def preflight_package_source(self):
         self._get_mozconfig()
 
     def package_source(self):
         """generates source archives and uploads them"""
         env = self.query_build_env()
         env.update(self.query_mach_build_env())
-        python = self.query_exe('python2.7')
         dirs = self.query_abs_dirs()
 
         self.run_command_m(
-            command=[python, 'mach', '--log-no-times', 'configure'],
+            command=[sys.executable, 'mach', '--log-no-times', 'configure'],
             cwd=dirs['abs_src_dir'],
             env=env, output_timeout=60*3, halt_on_failure=True,
         )
         self.run_command_m(
             command=[
                 'make', 'source-package', 'hg-bundle', 'source-upload',
                 'HG_BUNDLE_REVISION=%s' % self.query_revision(),
                 'UPLOAD_HG_BUNDLE=1',
@@ -1838,19 +1833,18 @@ or run without that action (ie: --no-{ac
             self.info('Skipping due to forced artifact build.')
             return
         c = self.config
         dirs = self.query_abs_dirs()
 
         env = self.query_build_env()
         env.update(self.query_check_test_env())
 
-        python = self.query_exe('python2.7')
         cmd = [
-            python, 'mach',
+            sys.executable, 'mach',
             '--log-no-times',
             'build',
             '-v',
             '--keep-going',
             'check',
         ]
 
         parser = CheckTestCompleteParser(config=c,
@@ -2211,19 +2205,18 @@ or run without that action (ie: --no-{ac
                 AUTOMATION_EXIT_CODES[::-1]
             )
 
     def valgrind_test(self):
         '''Execute mach's valgrind-test for memory leaks'''
         env = self.query_build_env()
         env.update(self.query_mach_build_env())
 
-        python = self.query_exe('python2.7')
         return_code = self.run_command_m(
-            command=[python, 'mach', 'valgrind-test'],
+            command=[sys.executable, 'mach', 'valgrind-test'],
             cwd=self.query_abs_dirs()['abs_src_dir'],
             env=env, output_timeout=self.config.get('max_build_output_timeout', 60 * 40)
         )
         if return_code:
             self.return_code = self.worst_level(
                 EXIT_STATUS_DICT[TBPL_FAILURE],  self.return_code,
                 AUTOMATION_EXIT_CODES[::-1]
             )
--- a/testing/mozharness/mozharness/mozilla/l10n/locales.py
+++ b/testing/mozharness/mozharness/mozilla/l10n/locales.py
@@ -141,21 +141,20 @@ class LocalesMixin(ChunkingMixin):
             locales = self.read_from_file(locales_file).split()
         self.info("self.l10n_revisions: %s" % pprint.pformat(self.l10n_revisions))
         self.info("locales: %s" % locales)
         return locales
 
     def run_compare_locales(self, locale, halt_on_failure=False):
         dirs = self.query_abs_dirs()
         env = self.query_l10n_env()
-        python = self.query_exe('python2.7')
         compare_locales_error_list = list(PythonErrorList)
         self.rmtree(dirs['abs_merge_dir'])
         self.mkdir_p(dirs['abs_merge_dir'])
-        command = [python, 'mach', 'compare-locales',
+        command = [sys.executable, 'mach', 'compare-locales',
                    '--merge-dir', dirs['abs_merge_dir'],
                    '--l10n-ini', os.path.join(dirs['abs_locales_src_dir'], 'l10n.ini'),
                    '--l10n-base', dirs['abs_l10n_dir'], locale]
         self.info("*** BEGIN compare-locales %s" % locale)
         status = self.run_command(command,
                                   halt_on_failure=halt_on_failure,
                                   env=env,
                                   cwd=dirs['abs_mozilla_dir'],
--- a/testing/mozharness/scripts/desktop_l10n.py
+++ b/testing/mozharness/scripts/desktop_l10n.py
@@ -693,18 +693,17 @@ class DesktopSingleLocale(LocalesMixin, 
 
     def _mach_configure(self):
         """calls mach configure"""
         env = self.query_bootstrap_env()
         target = ["configure"]
         return self._mach(target=target, env=env)
 
     def _get_mach_executable(self):
-        python = self.query_exe('python2.7')
-        return [python, 'mach']
+        return [sys.executable, 'mach']
 
     def _get_make_executable(self):
         config = self.config
         dirs = self.query_abs_dirs()
         if config.get('enable_mozmake'):  # e.g. windows
             make = r"/".join([dirs['abs_mozilla_dir'], 'mozmake.exe'])
             # mysterious subprocess errors, let's try to fix this path...
             make = make.replace('\\', '/')
--- a/testing/mozharness/scripts/desktop_partner_repacks.py
+++ b/testing/mozharness/scripts/desktop_partner_repacks.py
@@ -167,18 +167,17 @@ class DesktopPartnerRepacks(ReleaseMixin
                    args=(repo,),
                    error_level=FATAL,
                    cleanup=self._repo_cleanup(),
                    good_statuses=[0],
                    sleeptime=5)
 
     def repack(self):
         """creates the repacks"""
-        python = self.query_exe("python2.7")
-        repack_cmd = [python, "partner-repacks.py",
+        repack_cmd = [sys.executable, "partner-repacks.py",
                       "-v", self.config['version'],
                       "-n", str(self.config['build_number'])]
         if self.config.get('platform'):
             repack_cmd.extend(["--platform", self.config['platform']])
         if self.config.get('partner'):
             repack_cmd.extend(["--partner", self.config['partner']])
         if self.config.get('s3cfg'):
             repack_cmd.extend(["--s3cfg", self.config['s3cfg']])
--- a/testing/mozharness/scripts/repackage.py
+++ b/testing/mozharness/scripts/repackage.py
@@ -73,20 +73,19 @@ class Repackage(BaseScript):
             if key not in abs_dirs:
                 abs_dirs[key] = dirs[key]
         self.abs_dirs = abs_dirs
         return self.abs_dirs
 
     def repackage(self):
         config = self.config
         dirs = self.query_abs_dirs()
-        python = self.query_exe('python2.7')
         infile = os.path.join(config['input_home'], config['input_filename'])
         outfile = os.path.join(dirs['abs_upload_dir'], config['output_filename'])
-        command = [python, 'mach', '--log-no-times', 'repackage',
+        command = [sys.executable, 'mach', '--log-no-times', 'repackage',
                    '--input', infile,
                    '--output', outfile]
         return self.run_command(
             command=command,
             cwd=dirs['abs_mozilla_dir'],
             halt_on_failure=True,
         )
 
@@ -130,18 +129,17 @@ class Repackage(BaseScript):
         # print its contents
         self.read_from_file(abs_mozconfig_path, error_level=FATAL)
 
         # finally, copy the mozconfig to a path that 'mach build' expects it to be
         self.copyfile(abs_mozconfig_path, os.path.join(dirs['abs_mozilla_dir'], '.mozconfig'))
 
     def _run_configure(self):
         dirs = self.query_abs_dirs()
-        python = self.query_exe('python2.7')
-        command = [python, 'mach', '--log-no-times', 'configure']
+        command = [sys.executable, 'mach', '--log-no-times', 'configure']
         return self.run_command(
             command=command,
             cwd=dirs['abs_mozilla_dir'],
             output_timeout=60*3,
             halt_on_failure=True,
         )