[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] 05/76: Bug 1718878 - Updates to the build system to enable compatibility with Python 3.10 (Mainly regarding collections.abc) r=mhentges, webdriver-reviewers, whimboo a=RyanVM



This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch tor-browser-91.8.0esr-11.0-1
in repository tor-browser.

commit e4e7f5c7dbeafe4d497e79eaade06ec1b0aeb155
Author: Alex Hochheiden <ahochheiden@xxxxxxxxxxx>
AuthorDate: Wed Oct 27 13:35:13 2021 +0000

    Bug 1718878 - Updates to the build system to enable compatibility with Python 3.10 (Mainly regarding collections.abc) r=mhentges,webdriver-reviewers,whimboo a=RyanVM
    
    Previously, collections.abc was available from the collections import. In Python
    3.10, they were explicitly moved to collections.abc. As such, any references to
    collections abstract base classes need to import collections.abc in Python 3.10.
    
    More reading here: https://docs.python.org/3/library/collections.abc.html
    
    Differential Revision: https://phabricator.services.mozilla.com/D128838
---
 configure.py                                             | 7 +------
 testing/marionette/client/marionette_driver/wait.py      | 2 +-
 testing/mozbase/manifestparser/manifestparser/filters.py | 6 +-----
 testing/mozbase/versioninfo.py                           | 2 +-
 4 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/configure.py b/configure.py
index 5622500a0f6f0..70bfbb1998e0e 100644
--- a/configure.py
+++ b/configure.py
@@ -13,12 +13,7 @@ import os
 import sys
 import textwrap
 
-
-try:
-    from collections.abc import Iterable
-except ImportError:
-    from collections import Iterable
-
+from collections.abc import Iterable
 
 base_dir = os.path.abspath(os.path.dirname(__file__))
 sys.path.insert(0, os.path.join(base_dir, "python", "mozboot"))
diff --git a/testing/marionette/client/marionette_driver/wait.py b/testing/marionette/client/marionette_driver/wait.py
index caa9cb1f86bcb..103ff6876d739 100644
--- a/testing/marionette/client/marionette_driver/wait.py
+++ b/testing/marionette/client/marionette_driver/wait.py
@@ -87,7 +87,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 ccbec1f86ff7e..676bec9a304b1 100644
--- a/testing/mozbase/manifestparser/manifestparser/filters.py
+++ b/testing/mozbase/manifestparser/manifestparser/filters.py
@@ -13,11 +13,7 @@ from __future__ import absolute_import, division
 import itertools
 import os
 from collections import defaultdict
-
-try:
-    from collections.abc import MutableSequence
-except ImportError:
-    from collections import MutableSequence
+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 d058ca2dd6545..fb7b715373aeb 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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits