mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -07:00
Python 3.8 collections compatibility fixes.
Includes a new pylint blacklist plugin to prevent regressions.
This commit is contained in:
parent
c4d1f0d416
commit
a11f631ee4
56 changed files with 317 additions and 104 deletions
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue