cros_sdk: preserve sys.executable usage when reexecing

If the user's $PATH includes one (newer) version of `python3`, make
sure use that same one when reexecing in case the new sudo $PATH has
a different (older) version of `python3` that we don't support.

BUG=b:162183865
TEST=CQ passes

Change-Id: I52020288004e2024b619ece8438bf2f2f8903932
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2324356
Reviewed-by: Michael Mortensen <mmortensen@google.com>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/cros_sdk.py b/scripts/cros_sdk.py
index 83145ee..6b4cfcb 100644
--- a/scripts/cros_sdk.py
+++ b/scripts/cros_sdk.py
@@ -673,7 +673,9 @@
   the chroot can't mess with our mounts.
   """
   if os.geteuid() != 0:
-    cmd = _SudoCommand() + ['--'] + argv
+    # Make sure to preserve the active Python executable in case the version
+    # we're running as is not the default one found via the (new) $PATH.
+    cmd = _SudoCommand() + ['--'] + [sys.executable] + argv
     logging.debug('Reexecing self via sudo:\n%s', cros_build_lib.CmdToStr(cmd))
     os.execvp(cmd[0], cmd)
   else: