aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs-78/0005-Fixup-compatibility-of-mozbuild-with-Python-3.10.patch
blob: d069d00afa68ab27cc2b7a7eab7d0b0e490ddafc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
From a88d0c8e27b48344942187c2611bb121bde9332d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <fzatlouk@redhat.com>
Date: Tue, 13 Jul 2021 11:46:20 +0200
Subject: [PATCH] Fixup compatibility of mozbuild with Python 3.10

Stolen from [1]

[1] https://src.fedoraproject.org/rpms/mozjs78/raw/rawhide/f/Fixup-compatibility-of-mozbuild-with-Python-3.10.patch

Upstream-Status: Pending

---
 python/mach/mach/config.py                                    | 4 ++--
 python/mach/mach/decorators.py                                | 2 +-
 python/mozbuild/mozbuild/backend/configenvironment.py         | 3 ++-
 python/mozbuild/mozbuild/makeutil.py                          | 2 +-
 python/mozbuild/mozbuild/util.py                              | 2 +-
 testing/marionette/client/marionette_driver/wait.py           | 2 +-
 testing/mozbase/manifestparser/manifestparser/filters.py      | 3 ++-
 testing/mozbase/versioninfo.py                                | 2 +-
 testing/web-platform/tests/tools/manifest/vcs.py              | 2 +-
 .../web-platform/tests/tools/third_party/h2/h2/settings.py    | 2 +-
 .../tests/tools/third_party/html5lib/html5lib/_trie/_base.py  | 2 +-
 .../tools/third_party/html5lib/html5lib/treebuilders/dom.py   | 2 +-
 .../tests/tools/third_party/hyper/hyper/common/headers.py     | 2 +-
 .../tests/tools/third_party/hyper/hyper/h2/settings.py        | 2 +-
 .../tests/tools/third_party/hyper/hyper/http11/connection.py  | 4 ++--
 .../third_party/hyper/hyper/packages/hyperframe/flags.py      | 2 +-
 .../tests/tools/third_party/hyperframe/hyperframe/flags.py    | 2 +-
 testing/web-platform/tests/tools/wptserve/wptserve/config.py  | 3 ++-
 testing/web-platform/tests/webdriver/tests/support/sync.py    | 2 +-
 19 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/python/mach/mach/config.py b/python/mach/mach/config.py
index 7210eca82..edb4d2e93 100644
--- a/python/mach/mach/config.py
+++ b/python/mach/mach/config.py
@@ -144,7 +144,7 @@ def reraise_attribute_error(func):
     return _
 
 
-class ConfigSettings(collections.Mapping):
+class ConfigSettings(collections.abc.Mapping):
     """Interface for configuration settings.
 
     This is the main interface to the configuration.
@@ -190,7 +190,7 @@ class ConfigSettings(collections.Mapping):
     will result in exceptions being raised.
     """
 
-    class ConfigSection(collections.MutableMapping, object):
+    class ConfigSection(collections.abc.MutableMapping, object):
         """Represents an individual config section."""
         def __init__(self, config, name, settings):
             object.__setattr__(self, '_config', config)
diff --git a/python/mach/mach/decorators.py b/python/mach/mach/decorators.py
index 27f7f34a6..5f63271a3 100644
--- a/python/mach/mach/decorators.py
+++ b/python/mach/mach/decorators.py
@@ -140,7 +140,7 @@ def CommandProvider(cls):
               'Conditions argument must take a list ' + \
               'of functions. Found %s instead.'
 
-        if not isinstance(command.conditions, collections.Iterable):
+        if not isinstance(command.conditions, collections.abc.Iterable):
             msg = msg % (command.name, type(command.conditions))
             raise MachError(msg)
 
diff --git a/python/mozbuild/mozbuild/backend/configenvironment.py b/python/mozbuild/mozbuild/backend/configenvironment.py
index 20d1a9fa6..8747958bd 100644
--- a/python/mozbuild/mozbuild/backend/configenvironment.py
+++ b/python/mozbuild/mozbuild/backend/configenvironment.py
@@ -9,7 +9,8 @@ import six
 import sys
 import json
 
-from collections import Iterable, OrderedDict
+from collections import OrderedDict
+from collections.abc import Iterable
 from types import ModuleType
 
 import mozpack.path as mozpath
diff --git a/python/mozbuild/mozbuild/makeutil.py b/python/mozbuild/mozbuild/makeutil.py
index 4da1a3b26..4ce56848c 100644
--- a/python/mozbuild/mozbuild/makeutil.py
+++ b/python/mozbuild/mozbuild/makeutil.py
@@ -7,7 +7,7 @@ from __future__ import absolute_import, print_function, unicode_literals
 import os
 import re
 import six
-from collections import Iterable
+from collections.abc import Iterable
 
 
 class Makefile(object):
diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py
index 044cf645c..98ed3ef52 100644
--- a/python/mozbuild/mozbuild/util.py
+++ b/python/mozbuild/mozbuild/util.py
@@ -782,7 +782,7 @@ class HierarchicalStringList(object):
         self._strings = StrictOrderingOnAppendList()
         self._children = {}
 
-    class StringListAdaptor(collections.Sequence):
+    class StringListAdaptor(collections.abc.Sequence):
         def __init__(self, hsl):
             self._hsl = hsl
 
diff --git a/testing/marionette/client/marionette_driver/wait.py b/testing/marionette/client/marionette_driver/wait.py
index eeaa1e23d..c147f463f 100644
--- a/testing/marionette/client/marionette_driver/wait.py
+++ b/testing/marionette/client/marionette_driver/wait.py
@@ -82,7 +82,7 @@ class Wait(object):
 
         exceptions = []
         if ignored_exceptions is not None:
-            if isinstance(ignored_exceptions, collections.Iterable):
+            if isinstance(ignored_exceptions, collections.abc.Iterable):
                 exceptions.extend(iter(ignored_exceptions))
             else:
                 exceptions.append(ignored_exceptions)
diff --git a/testing/mozbase/manifestparser/manifestparser/filters.py b/testing/mozbase/manifestparser/manifestparser/filters.py
index 287ee033b..b1d608003 100644
--- a/testing/mozbase/manifestparser/manifestparser/filters.py
+++ b/testing/mozbase/manifestparser/manifestparser/filters.py
@@ -12,7 +12,8 @@ from __future__ import absolute_import
 
 import itertools
 import os
-from collections import defaultdict, MutableSequence
+from collections import defaultdict
+from collections.abc import MutableSequence
 
 import six
 from six import string_types
diff --git a/testing/mozbase/versioninfo.py b/testing/mozbase/versioninfo.py
index 91d1a0473..8c1680069 100755
--- a/testing/mozbase/versioninfo.py
+++ b/testing/mozbase/versioninfo.py
@@ -11,7 +11,7 @@ from commit messages.
 
 from __future__ import absolute_import, print_function
 
-from collections import Iterable
+from collections.abc import Iterable
 from distutils.version import StrictVersion
 import argparse
 import os
diff --git a/testing/web-platform/tests/tools/manifest/vcs.py b/testing/web-platform/tests/tools/manifest/vcs.py
index 7c0feeb81..05ee19c7c 100644
--- a/testing/web-platform/tests/tools/manifest/vcs.py
+++ b/testing/web-platform/tests/tools/manifest/vcs.py
@@ -3,7 +3,7 @@ import json
 import os
 import stat
 from collections import deque
-from collections import MutableMapping
+from collections.abc import MutableMapping
 
 from six import with_metaclass, PY2
 
diff --git a/testing/web-platform/tests/tools/third_party/h2/h2/settings.py b/testing/web-platform/tests/tools/third_party/h2/h2/settings.py
index 3da720329..e097630e9 100644
--- a/testing/web-platform/tests/tools/third_party/h2/h2/settings.py
+++ b/testing/web-platform/tests/tools/third_party/h2/h2/settings.py
@@ -88,7 +88,7 @@ class ChangedSetting:
         )
 
 
-class Settings(collections.MutableMapping):
+class Settings(collections.abc.MutableMapping):
     """
     An object that encapsulates HTTP/2 settings state.
 
diff --git a/testing/web-platform/tests/tools/third_party/html5lib/html5lib/_trie/_base.py b/testing/web-platform/tests/tools/third_party/html5lib/html5lib/_trie/_base.py
index a1158bbbf..a9295a2ba 100644
--- a/testing/web-platform/tests/tools/third_party/html5lib/html5lib/_trie/_base.py
+++ b/testing/web-platform/tests/tools/third_party/html5lib/html5lib/_trie/_base.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import, division, unicode_literals
 
-from collections import Mapping
+from collections.abc import Mapping
 
 
 class Trie(Mapping):
diff --git a/testing/web-platform/tests/tools/third_party/html5lib/html5lib/treebuilders/dom.py b/testing/web-platform/tests/tools/third_party/html5lib/html5lib/treebuilders/dom.py
index dcfac220b..818a33433 100644
--- a/testing/web-platform/tests/tools/third_party/html5lib/html5lib/treebuilders/dom.py
+++ b/testing/web-platform/tests/tools/third_party/html5lib/html5lib/treebuilders/dom.py
@@ -1,7 +1,7 @@
 from __future__ import absolute_import, division, unicode_literals
 
 
-from collections import MutableMapping
+from collections.abc import MutableMapping
 from xml.dom import minidom, Node
 import weakref
 
diff --git a/testing/web-platform/tests/tools/third_party/hyper/hyper/common/headers.py b/testing/web-platform/tests/tools/third_party/hyper/hyper/common/headers.py
index 655a591ac..6454f550a 100644
--- a/testing/web-platform/tests/tools/third_party/hyper/hyper/common/headers.py
+++ b/testing/web-platform/tests/tools/third_party/hyper/hyper/common/headers.py
@@ -10,7 +10,7 @@ import collections
 from hyper.common.util import to_bytestring, to_bytestring_tuple
 
 
-class HTTPHeaderMap(collections.MutableMapping):
+class HTTPHeaderMap(collections.abc.MutableMapping):
     """
     A structure that contains HTTP headers.
 
diff --git a/testing/web-platform/tests/tools/third_party/hyper/hyper/h2/settings.py b/testing/web-platform/tests/tools/third_party/hyper/hyper/h2/settings.py
index fedc5e3c4..040afea92 100755
--- a/testing/web-platform/tests/tools/third_party/hyper/hyper/h2/settings.py
+++ b/testing/web-platform/tests/tools/third_party/hyper/hyper/h2/settings.py
@@ -151,7 +151,7 @@ class ChangedSetting:
         )
 
 
-class Settings(collections.MutableMapping):
+class Settings(collections.abc.MutableMapping):
     """
     An object that encapsulates HTTP/2 settings state.
 
diff --git a/testing/web-platform/tests/tools/third_party/hyper/hyper/http11/connection.py b/testing/web-platform/tests/tools/third_party/hyper/hyper/http11/connection.py
index 61361c358..a214311d2 100644
--- a/testing/web-platform/tests/tools/third_party/hyper/hyper/http11/connection.py
+++ b/testing/web-platform/tests/tools/third_party/hyper/hyper/http11/connection.py
@@ -10,7 +10,7 @@ import os
 import socket
 import base64
 
-from collections import Iterable, Mapping
+from collections.abc import Iterable, Mapping
 
 import collections
 from hyperframe.frame import SettingsFrame
@@ -295,7 +295,7 @@ class HTTP11Connection(object):
                 return
 
             # Iterables that set a specific content length.
-            elif isinstance(body, collections.Iterable):
+            elif isinstance(body, collections.abc.Iterable):
                 for item in body:
                     try:
                         self._sock.send(item)
diff --git a/testing/web-platform/tests/tools/third_party/hyper/hyper/packages/hyperframe/flags.py b/testing/web-platform/tests/tools/third_party/hyper/hyper/packages/hyperframe/flags.py
index e8f630056..8f2ea689b 100644
--- a/testing/web-platform/tests/tools/third_party/hyper/hyper/packages/hyperframe/flags.py
+++ b/testing/web-platform/tests/tools/third_party/hyper/hyper/packages/hyperframe/flags.py
@@ -11,7 +11,7 @@ import collections
 Flag = collections.namedtuple("Flag", ["name", "bit"])
 
 
-class Flags(collections.MutableSet):
+class Flags(collections.abc.MutableSet):
     """
     A simple MutableSet implementation that will only accept known flags as elements.
 
diff --git a/testing/web-platform/tests/tools/third_party/hyperframe/hyperframe/flags.py b/testing/web-platform/tests/tools/third_party/hyperframe/hyperframe/flags.py
index 05b35017e..14c352e10 100644
--- a/testing/web-platform/tests/tools/third_party/hyperframe/hyperframe/flags.py
+++ b/testing/web-platform/tests/tools/third_party/hyperframe/hyperframe/flags.py
@@ -11,7 +11,7 @@ import collections
 Flag = collections.namedtuple("Flag", ["name", "bit"])
 
 
-class Flags(collections.MutableSet):
+class Flags(collections.abc.MutableSet):
     """
     A simple MutableSet implementation that will only accept known flags as
     elements.
diff --git a/testing/web-platform/tests/tools/wptserve/wptserve/config.py b/testing/web-platform/tests/tools/wptserve/wptserve/config.py
index 7766565fe..3c1c36d6f 100644
--- a/testing/web-platform/tests/tools/wptserve/wptserve/config.py
+++ b/testing/web-platform/tests/tools/wptserve/wptserve/config.py
@@ -2,7 +2,8 @@ import copy
 import logging
 import os
 
-from collections import defaultdict, Mapping
+from collections import defaultdict
+from collections.abc import Mapping
 from six import integer_types, iteritems, itervalues, string_types
 
 from . import sslutils
diff --git a/testing/web-platform/tests/webdriver/tests/support/sync.py b/testing/web-platform/tests/webdriver/tests/support/sync.py
index 3fc77131c..8e8f6b819 100644
--- a/testing/web-platform/tests/webdriver/tests/support/sync.py
+++ b/testing/web-platform/tests/webdriver/tests/support/sync.py
@@ -81,7 +81,7 @@ class Poll(object):
 
         exceptions = []
         if ignored_exceptions is not None:
-            if isinstance(ignored_exceptions, collections.Iterable):
+            if isinstance(ignored_exceptions, collections.abc.Iterable):
                 exceptions.extend(iter(ignored_exceptions))
             else:
                 exceptions.append(ignored_exceptions)
-- 
2.31.1