Skip to content

Commit

Permalink
Fixed new Pylint warning deprecated-class on collections
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
  • Loading branch information
andy-maier committed Jun 30, 2021
1 parent 6cf8d68 commit 4a2d1c0
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/changes.rst
Expand Up @@ -27,6 +27,9 @@ Released: not yet

**Bug fixes:**

* Fixed new Pylint issue 'deprecated-class' that is raised when importing from
collections in Python versions that do not support collections.abc yet.

**Enhancements:**

**Cleanup:**
Expand Down
2 changes: 1 addition & 1 deletion immutable_views/_dict_view.py
Expand Up @@ -22,7 +22,7 @@
from collections.abc import Mapping
except ImportError:
# Python 2
from collections import Mapping
from collections import Mapping # pylint: disable=deprecated-class

__all__ = ['DictView']

Expand Down
2 changes: 1 addition & 1 deletion immutable_views/_list_view.py
Expand Up @@ -20,7 +20,7 @@
from collections.abc import Sequence
except ImportError:
# Python 2
from collections import Sequence
from collections import Sequence # pylint: disable=deprecated-class

__all__ = ['ListView']

Expand Down
2 changes: 1 addition & 1 deletion immutable_views/_set_view.py
Expand Up @@ -20,7 +20,7 @@
from collections.abc import Set
except ImportError:
# Python 2
from collections import Set
from collections import Set # pylint: disable=deprecated-class

__all__ = ['SetView']

Expand Down
1 change: 1 addition & 0 deletions tests/unittest/test_dict_view.py
Expand Up @@ -24,6 +24,7 @@
from collections.abc import KeysView, ValuesView, ItemsView, Iterator, \
MutableMapping, Mapping
except ImportError:
# pylint: disable=deprecated-class
from collections import KeysView, ValuesView, ItemsView, Iterator, \
MutableMapping, Mapping
import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/unittest/test_list_view.py
Expand Up @@ -23,6 +23,7 @@
from collections.abc import Sequence, MutableSequence
except ImportError:
# Python 2
# pylint: disable=deprecated-class
from collections import Sequence, MutableSequence
import pytest
from nocaselist import NocaseList
Expand Down
1 change: 1 addition & 0 deletions tests/unittest/test_set_view.py
Expand Up @@ -23,6 +23,7 @@
from collections.abc import Set, MutableSet
except ImportError:
# Python 2
# pylint: disable=deprecated-class
from collections import Set, MutableSet
import pytest

Expand Down

0 comments on commit 4a2d1c0

Please sign in to comment.