mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Python 3.8 collections compatibility fixes.
Includes a new pylint blacklist plugin to prevent regressions.
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user