• Raul Tambre's avatar
    gclient_eval, gclient_utils: Fix Python 3.9 removal of collections members · 6693d092
    Raul Tambre authored
    Various collections module members were removed in Python 3.9 after being deprecated and moved to collections.abc in earlier Python 3 versions.
    For accessing these members alias collections_abc as:
    * collections.abc on Python 3
    * collections on Python 2
    
    Traceback (most recent call last):
      File "C:\Google\depot_tools\gclient.py", line 107, in <module>
        import gclient_eval
      File "C:\Google\depot_tools\gclient_eval.py", line 11, in <module>
        import gclient_utils
      File "C:\Google\depot_tools\gclient_utils.py", line 1201, in <module>
        class FrozenDict(collections.Mapping):
    AttributeError: module 'collections' has no attribute 'Mapping'
    
    Traceback (most recent call last):
      File "C:\Google\depot_tools\gclient.py", line 107, in <module>
        import gclient_eval
      File "C:\Google\depot_tools\gclient_eval.py", line 25, in <module>
        class _NodeDict(collections.MutableMapping):
    AttributeError: module 'collections' has no attribute 'MutableMapping'
    
    Bug: 984182
    Change-Id: I7a4417978b93e29397e63764e4570a598c075bc0
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2043879
    Auto-Submit: Raul Tambre <raul@tambre.ee>
    Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
    Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
    6693d092
gclient_eval.py 31.2 KB