Browse Source

python 3.11 fix

Frank-Rainer Grahl 4 months ago
parent
commit
f3357d5ba7
2 changed files with 87 additions and 0 deletions
  1. 86 0
      mozilla-release/patches/1799483-108a1.patch
  2. 1 0
      mozilla-release/patches/series

+ 86 - 0
mozilla-release/patches/1799483-108a1.patch

@@ -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()

+ 1 - 0
mozilla-release/patches/series

@@ -7014,3 +7014,4 @@ TOP-NOBUG-seamonkey-credits.patch
 1870579-126a1.patch
 1892449-127a1.patch
 1893891-127a1.patch
+1799483-108a1.patch