|
@@ -0,0 +1,86 @@
|
|
|
|
+# HG changeset patch
|
|
|
|
+# User Kagami Sascha Rosylight <krosylight@mozilla.com>
|
|
|
|
+# Date 1667864157 0
|
|
|
|
+# Node ID 1e72b7d6fe9a22b3e6ee1f56ff96df3b8c918120
|
|
|
|
+# Parent b5e6723fc7afa8c5cbf0f353e50fd9bac804723d
|
|
|
|
+Bug 1799483 - Simplify _execute_child with catch-all syntax r=releng-reviewers,gbrown
|
|
|
|
+
|
|
|
|
+That syntax is added in Python 3.0 by https://peps.python.org/pep-3132/.
|
|
|
|
+
|
|
|
|
+Differential Revision: https://phabricator.services.mozilla.com/D161484
|
|
|
|
+
|
|
|
|
+diff --git a/testing/mozbase/mozprocess/mozprocess/processhandler.py b/testing/mozbase/mozprocess/mozprocess/processhandler.py
|
|
|
|
+--- a/testing/mozbase/mozprocess/mozprocess/processhandler.py
|
|
|
|
++++ b/testing/mozbase/mozprocess/mozprocess/processhandler.py
|
|
|
|
+@@ -262,52 +262,35 @@ class ProcessHandlerMixin(object):
|
|
|
|
+ self._cleanup()
|
|
|
|
+ return self.returncode
|
|
|
|
+
|
|
|
|
+ """ Private Members of Process class """
|
|
|
|
+
|
|
|
|
+ if isWin:
|
|
|
|
+ # Redefine the execute child so that we can track process groups
|
|
|
|
+ def _execute_child(self, *args_tuple):
|
|
|
|
+- # workaround for bug 1670130
|
|
|
|
+- if sys.hexversion >= 0x03090000: # after 3.9.0
|
|
|
|
+- (args, executable, preexec_fn, close_fds,
|
|
|
|
+- pass_fds, cwd, env,
|
|
|
|
+- startupinfo, creationflags, shell,
|
|
|
|
+- p2cread, p2cwrite,
|
|
|
|
+- c2pread, c2pwrite,
|
|
|
|
+- errread, errwrite,
|
|
|
|
+- restore_signals,
|
|
|
|
+- gid, gids, uid,
|
|
|
|
+- umask,
|
|
|
|
+- start_new_session) = args_tuple
|
|
|
|
+- elif six.PY3:
|
|
|
|
+- (args, executable, preexec_fn, close_fds,
|
|
|
|
+- pass_fds, cwd, env,
|
|
|
|
+- startupinfo, creationflags, shell,
|
|
|
|
+- p2cread, p2cwrite,
|
|
|
|
+- c2pread, c2pwrite,
|
|
|
|
+- errread, errwrite,
|
|
|
|
+- restore_signals, start_new_session) = args_tuple
|
|
|
|
+- # workaround for bug 950894
|
|
|
|
+- elif sys.hexversion < 0x02070600: # prior to 2.7.6
|
|
|
|
+- (args, executable, preexec_fn, close_fds,
|
|
|
|
+- cwd, env, universal_newlines, startupinfo,
|
|
|
|
+- creationflags, shell,
|
|
|
|
+- p2cread, p2cwrite,
|
|
|
|
+- c2pread, c2pwrite,
|
|
|
|
+- errread, errwrite) = args_tuple
|
|
|
|
+- to_close = set()
|
|
|
|
+- else: # 2.7.6 and later
|
|
|
|
+- (args, executable, preexec_fn, close_fds,
|
|
|
|
+- cwd, env, universal_newlines, startupinfo,
|
|
|
|
+- creationflags, shell, to_close,
|
|
|
|
+- p2cread, p2cwrite,
|
|
|
|
+- c2pread, c2pwrite,
|
|
|
|
+- errread, errwrite) = args_tuple
|
|
|
|
++ (
|
|
|
|
++ args,
|
|
|
|
++ executable,
|
|
|
|
++ preexec_fn,
|
|
|
|
++ close_fds,
|
|
|
|
++ pass_fds,
|
|
|
|
++ cwd,
|
|
|
|
++ env,
|
|
|
|
++ startupinfo,
|
|
|
|
++ creationflags,
|
|
|
|
++ shell,
|
|
|
|
++ p2cread,
|
|
|
|
++ p2cwrite,
|
|
|
|
++ c2pread,
|
|
|
|
++ c2pwrite,
|
|
|
|
++ errread,
|
|
|
|
++ errwrite,
|
|
|
|
++ *_,
|
|
|
|
++ ) = args_tuple
|
|
|
|
+ if not isinstance(args, six.string_types):
|
|
|
|
+ args = subprocess.list2cmdline(args)
|
|
|
|
+
|
|
|
|
+ # Always or in the create new process group
|
|
|
|
+ creationflags |= winprocess.CREATE_NEW_PROCESS_GROUP
|
|
|
|
+
|
|
|
|
+ if startupinfo is None:
|
|
|
|
+ startupinfo = winprocess.STARTUPINFO()
|