diff options
| author | Jintao Zhang <zhangjintao9020@gmail.com> | 2018-10-23 11:52:48 +0800 |
|---|---|---|
| committer | Jintao Zhang <zhangjintao9020@gmail.com> | 2018-10-23 11:52:48 +0800 |
| commit | 5188a146c2d8ea0c0a80fd5dbdbaef6f43741083 (patch) | |
| tree | 6e43d3301481b38a2c665298ac8fb9d40cda8b07 /src | |
| parent | 7801a17adc566af818e4da2ea75c7a28974b745c (diff) | |
| download | flake8-5188a146c2d8ea0c0a80fd5dbdbaef6f43741083.tar.gz | |
Fix collections ABCs deprecation warning.
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/flake8/plugins/manager.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/flake8/plugins/manager.py b/src/flake8/plugins/manager.py index 1b9005e..e17fc17 100644 --- a/src/flake8/plugins/manager.py +++ b/src/flake8/plugins/manager.py @@ -1,6 +1,6 @@ """Plugin loading and management logic and classes.""" -import collections import logging +import sys import pkg_resources @@ -8,6 +8,11 @@ from flake8 import exceptions from flake8 import utils from flake8.plugins import notifier +if sys.version_info >= (3, 3): + import collections.abc as collections_abc +else: + import collections as collections_abc + LOG = logging.getLogger(__name__) __all__ = ( @@ -411,7 +416,7 @@ class PluginTypeManager(object): def generated_function(plugin): # noqa: D105 method = getattr(plugin, method_name, None) if method is not None and isinstance( - method, collections.Callable + method, collections_abc.Callable ): return method(optmanager, *args, **kwargs) |
