summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2021-09-20 09:14:19 +0200
committerGitHub <noreply@github.com>2021-09-20 09:14:19 +0200
commitdea0beb6b23359b8bbb5f0ce1f720b7fdb8c47e9 (patch)
tree22d784e36fb49d3cc6f8318c27de12c9f5546491
parent314cb9ffd369b5ab99688c885eb537c901e861eb (diff)
downloadpylint-git-dea0beb6b23359b8bbb5f0ce1f720b7fdb8c47e9.tar.gz
Remove `safe_decode()` and `deprecated_option()` from utils (#5046)
-rw-r--r--pylint/utils/__init__.py4
-rw-r--r--pylint/utils/utils.py28
2 files changed, 0 insertions, 32 deletions
diff --git a/pylint/utils/__init__.py b/pylint/utils/__init__.py
index 8bdd70259..77cb08b76 100644
--- a/pylint/utils/__init__.py
+++ b/pylint/utils/__init__.py
@@ -53,7 +53,6 @@ from pylint.utils.utils import (
_splitstrip,
_unquote,
decoding_stream,
- deprecated_option,
diff_string,
format_section,
get_global_option,
@@ -62,7 +61,6 @@ from pylint.utils.utils import (
get_rst_title,
normalize_text,
register_plugins,
- safe_decode,
tokenize_module,
)
@@ -75,7 +73,6 @@ __all__ = [
"_splitstrip",
"_unquote",
"decoding_stream",
- "deprecated_option",
"diff_string",
"FileState",
"format_section",
@@ -85,6 +82,5 @@ __all__ = [
"get_rst_title",
"normalize_text",
"register_plugins",
- "safe_decode",
"tokenize_module",
]
diff --git a/pylint/utils/utils.py b/pylint/utils/utils.py
index 231983aa6..fc89bbacd 100644
--- a/pylint/utils/utils.py
+++ b/pylint/utils/utils.py
@@ -137,14 +137,6 @@ def get_rst_section(section, options, doc=None):
return result
-def safe_decode(line, encoding, *args, **kwargs):
- """return decoded line from encoding or decode with default encoding"""
- try:
- return line.decode(encoding or sys.getdefaultencoding(), *args, **kwargs)
- except LookupError:
- return line.decode(sys.getdefaultencoding(), *args, **kwargs)
-
-
def decoding_stream(
stream: Union[BufferedReader, BytesIO],
encoding: str,
@@ -263,26 +255,6 @@ def get_global_option(
return default
-def deprecated_option(
- shortname=None, opt_type=None, help_msg=None, deprecation_msg=None
-):
- def _warn_deprecated(option, optname, *args): # pylint: disable=unused-argument
- if deprecation_msg:
- sys.stderr.write(deprecation_msg % (optname,))
-
- option = {
- "help": help_msg,
- "hide": True,
- "type": opt_type,
- "action": "callback",
- "callback": _warn_deprecated,
- "deprecated": True,
- }
- if shortname:
- option["shortname"] = shortname
- return option
-
-
def _splitstrip(string, sep=","):
"""return a list of stripped string by splitting the string given as
argument on `sep` (',' by default). Empty string are discarded.