diff options
| author | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2019-09-12 14:10:27 +0300 |
|---|---|---|
| committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-09-12 06:10:27 -0500 |
| commit | b72c0dd9a3ee5c992f94937b58de3b2153f4624d (patch) | |
| tree | 1161dcf81f4c8a81c1af254e164d92596437f3d1 /pylint/checkers/utils.py | |
| parent | 0b947809fc018963fce1745cda89649e6d66d0c7 (diff) | |
| download | pylint-git-b72c0dd9a3ee5c992f94937b58de3b2153f4624d.tar.gz | |
Remove redundant compatibility code (#3097)
We no longer support Python 2 so we can remove
the compatibility code we had in place for that version.
Diffstat (limited to 'pylint/checkers/utils.py')
| -rw-r--r-- | pylint/checkers/utils.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index fd38bfe9a..153bc40ff 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -34,7 +34,6 @@ import itertools import numbers import re import string -import sys from functools import lru_cache, partial from typing import Callable, Dict, Iterable, List, Match, Optional, Set, Tuple, Union @@ -52,12 +51,7 @@ COMP_NODE_TYPES = ( astroid.DictComp, astroid.GeneratorExp, ) -PY3K = sys.version_info[0] == 3 - -if not PY3K: - EXCEPTIONS_MODULE = "exceptions" -else: - EXCEPTIONS_MODULE = "builtins" +EXCEPTIONS_MODULE = "builtins" ABC_METHODS = { "abc.abstractproperty", "abc.abstractmethod", @@ -512,10 +506,7 @@ def parse_format_string( if char in "hlL": i, char = next_char(i) # Parse the conversion type (mandatory). - if PY3K: - flags = "diouxXeEfFgGcrs%a" - else: - flags = "diouxXeEfFgGcrs%" + flags = "diouxXeEfFgGcrs%a" if char not in flags: raise UnsupportedFormatCharacter(i) if key: |
