Python 3.8 collections compatibility fixes.

Includes a new pylint blacklist plugin to prevent regressions.
This commit is contained in:
Matt Clay 2018-10-05 01:22:25 -07:00
commit a11f631ee4
56 changed files with 317 additions and 104 deletions

View file

@ -10,20 +10,37 @@ Third parties should not use this.
from __future__ import absolute_import, division, print_function
__metaclass__ = type
try:
"""Python 3.3+ branch."""
from collections.abc import (
MappingView,
ItemsView,
KeysView,
ValuesView,
Mapping, MutableMapping,
Sequence, MutableSequence,
Set, MutableSet,
Container,
Hashable,
Sized,
Callable,
Iterable,
Iterator,
)
except ImportError:
"""Use old lib location under 2.6-3.2."""
from collections import (
MappingView,
ItemsView,
KeysView,
ValuesView,
Mapping, MutableMapping,
Sequence, MutableSequence,
Set, MutableSet,
Container,
Hashable,
Sized,
Callable,
Iterable,
Iterator,
)